Search code examples
javascriptshellmozillarhinokey-bindings

Rhino 1.7 in shell doesn't map the arrow keys for history


I downloaded Mozilla Rhino so I can use the interactive JavaScript console through

java -jar js.jar

I can get into the prompt, and everything is all working fine. Except... My arrow keys are not mapped to move the cursor back and forth or to use the history function with up and down. Now, according to the documentation, these features do exist in the interactive console, but they seem to break on Mac OS. I need some pointers to change these settings or add code to support this?

When using JSC, I do not have this problem.

Thanks,


Solution

  • There are no built-in key bindings when running just "js.jar" like that. What you may want to do is look into the JLine "console runner" project.