Closed fqliao closed 5 years ago
Which is the OS and terminal emulator you are using? In linux and Windows/gitbash home and end keys are working ok.
linux
Your key bindings should match the information given by infocmp.
Check infocmp -L1 | grep -e 'key.*home' -e 'key.*end'
which should gives you \E[1~
and \E[4~
. If that's the case, there's a bug in jline else there's a problem in your terminal settings.
If the problem is in your terminal configuration, one way around is to explicitely bind the keys:
KeyMap<Binding> keymap = reader.getKeyMaps().get(LineReader.MAIN);
keymap.bind(new Reference("beginning-of-line"), "\033[1~");
keymap.bind(new Reference("end-of-line"), "\033[4~");
Thank you very much! It works for linux.
Hello, pressing home key print "[1~" and end key print "[4~". Could you provide parsing for home key and end key?