Category: readline

In bash, how to make control-delete mean kill-word?

Bash uses readline, and readline can delete the word to the right of the cursor with “kill-word”. The problem is in recognizing the keypress of control-delete. When I press them in bash, “5~” is output on the screen. I could just bind for this, but it would mean that one day I need to type […]

Using GNU Readline; how can I add ncurses in the same program?

The title is a bit more specific than my actual goal: I have a command-line program which uses GNU Readline, primarily for command history (i.e. retrieving previous commands using up-arrow) and some other niceties. Right now the program’s output appears interspersed with the user’s input, which sometimes is OK but the output is asynchronous (it […]