I was trying to understand and remember keyboard shortcuts for bash. I was wondering why is the char 'u' used in
CTRL-u --- cancel the line before cursor location
While unix-line-discard
is a good mnemonic, the use of CTRL+U as a line-erase character precedes the invention of UNIX. It was used as such on various Digital Equipment (DEC) systems, including the PDP-8. For instance, from my dusty bookshelf I see that CTRL+U was used as line-erase in the PDP-8 Symbolic Editor (page 5-13 of the 1972 edition of the PDP-8 Introduction To Programming (Volume 1)
manual published by DEC). In fact, in the early days of UNIX, the @
character was often the default line-erase character. Other systems used CTRL+X for the same function, which made some sense since the ASCII control character description for it is Cancel
. The DEC convention of CTRL+U eventually won out in the popularity contest.
"unix-line-discard": http://cnswww.cns.cwru.edu/php/chet/readline/readline.html#SEC17
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With