When you press a key in xterm, it sends a character sequence that is determined by the translations in its X resources. Typically Ctrl+/ sends the single character ^_
(i.e. character number 31, like Ctrl+_). The shell interprets this control character as the undo command.
When you press the key in a Linux console, it sends a character sequence that is determined by the active keymap. The command loadkeys
loads a keymap. The location of the default keymap depends on the distribution and on the installed packages; on recent Ubuntu distributions, the console keymap is derived from the default XKB keymap. Many default keymap assign Backspace (which is called Delete
in this context: it's character 127) to Ctrl+/ (I don't know why); you can change this by using the following keymap fragment:
keycode 53 = slash question
control keycode 53 = Control_underscore
alt keycode 53 = Meta_slash
shift alt keycode 53 = Meta_question
If you have a file called /etc/console/boottime.kmap.gz
, edit that. If you have a file /etc/default/keyboard
, read it and follow the instructions.