Cursor movement keys not working properly in jshell on macOS terminal

Viewed 49

In the following start to a snippet I had typed some nonsense asd that I then hit backspace to overwrite:

jshell> void asd$<3$<3>

As can be seen instead of backspace I got $<3 . Right Arrow similarly does $<2 . Actually Left Arrow works properly. I do not have an ~/.inputrc file. Also notably iTerm2 works correctly.

So what might be happening here?

1 Answers

You need to execute this command because JLine (the library used by jshell to handle command line editing) does not support MacOS:

echo "jline.terminal=unix" > $HOME/.jline.rc
Related