Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle keypad mode cursor key escape sequences. (#203)
Normally the terminal uses CSI escape sequences when the UP, DOWN, LEFT, RIGHT and HOME, END keys are pressed. These look like the following ESC [ A etc, where ESC [ is the CSI sequence. xterm and other terminals however can generate an alternative escape sequence called SS3 if in the application keypad mode. This sequence is ESC O A etc. Bash readline understands both modes so nowadays you rarely see OA being printed when you press the up arrow while the terminal is using the keypad mode. readline currently does not understand these sequences. To test this fix, I used an xterm and put it in keypad mode using the command "tput smkx". Then I started the readline-demo and tried using arrow keys. Without this fix, OA is printed when I press up. With this fix, readline fetches the previous command as per regular mode. After testing you can escape back to regular mode using "tput rmkx".
- Loading branch information