Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Ctrl-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.



getpass supports readline shortcuts? TIL


Is 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).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: