Open kriszyp opened 15 years ago
The readline package is supposed to be generic, but the Rhino shell input has JavaScript specific behavior. Maybe we should just detect Rhino in the REPL and use this there?
I thought that the repl module was supposed engine/platform agnostic, whereas the readline package would handle adapting to different engines. Rhino is certainly one of the engines, so shouldn't this be detected and handled at the readline level? If you want the detection move to the repl module, I can do that, just wanted to make sure.
By "generic" I mean it implements a generic readline prompt, not one which includes JavaScript autocompletion, etc. You should be able to use the plain "readline" module for any sort of REPL, not just JavaScript.
I would be ok with having, say, a "readline/javascript" module (or readline.readLineJS()) or something like that, which uses the Rhino REPL, and falls back to the standard readline.
readline should use the Rhino's shell input, rather than going directly to jline, so that jline works in both debugger and command line: http://github.com/kriszyp/narwhal/commit/7bbdce2ed704503f0156ef6a59da08a801a722df