nfischer / n_shell

A NodeJS REPL with ShellJS loaded by default
https://www.npmjs.com/package/n_shell
MIT License
8 stars 1 forks source link

Node v12 REPL's function preview interacts poorly with shelljs #10

Open nfischer opened 2 years ago

nfischer commented 2 years ago

It looks like node v12's REPL will run javascript code as you type it into the console. This has some annoying interactions with shelljs commands though because:

  1. these have side effects (ex. shell.clear() clears the console)
  2. n_shell has a feature to execute commands without typing parentheses (ex. ls<CR> is the same as ls()<CR>)

These combine to make for a really unpleasant user experience. Ex. typing touch (without pressing enter) will cause touch() to be eagerly executed by the REPL preview, which outputs an error (touch: no files given).

Maybe we should just disable the feature referenced in (2) and require parentheses. For some reason the node REPL won't show the preview for ls(), only for ls.