Tip: get all Unix console programs to support arrow keys
[2011-01-04]
emacs, dev, hack, unix, shell
It is a major nuisance: You run a Unix program on the console, it wants text input from you, but all you can do is type and remove the most recent character. No arrow keys and no input history. Java console programs are notorious for this. A work-around is to use the Emacs shell mode as follows:
- Start Emacs. Use the -nw (no window) option if you want to start it inside the console.
- Type Esc-X “shell” Return
- Now text input is much more comfortable.
- History: Esc-P goes to previous text input, Esc-N moves forward in time. You can also just move around the screen with the arrow keys, edit and hit Return.
- Leave Emacs via Ctrl-X Ctrl-C.