4 ms·
I've been using bash/zsh for 18 years and did not know about ctrl-W, ctrl-Y. This might be a game changer for me!
by treve 7y ago
I've been using bash/zsh for 18 years and did not know about ctrl-W, ctrl-Y. This might be a game changer for me!
- kazinator 7y agoCtrl-W is the standard default character for erasing a word in the POSIX TTY cooked mode. Thus it works even when using programs that don't have a line editor. Ctrl-U similarly erases the whole line. GNU Readline's key bindings for Ctrl-W and Ctrl-U mimic these actions for consistency. Ctrl-U is very useful for retyping a botched password at the login: prompt.
- saagarjha 7y agogetpass supports readline shortcuts? TIL
- kazinator 7y agoIs my comment not clear? They are not "readline shortcuts"; readline got them from Unix. GNU targeted Unix as the system to replace with free software and adopted its conventions. Beside Ctrl-W and Ctrl-U, another convention from the Unix TTY found in readline is Ctrl-D. getpass doesn't support editing at all; it runs the TTY in "cooked mode", just with echo disabled. The operating system kernel implements the rudimentary editing (Ctrl-W and Ctrl-U).