News for hackers. Stuff that matters.
Re:What typing ^D does on Unix (2009) by klodolph on Tuesday September 06, 2016 @03:14PM (#12438497)
To elaborate on yebyen's answer: these shortcuts can be handled in different layers of your stack. By default, ^U will be handled by your terminal emulator, and it will only delete the buffer, it won't remember what you've deleted. However, programs can ask the terminal emulator to pass ^U through to them so they can handle it themselves. This happens if you use libeditline (or libreadline), and these libraries implement a per-application buffer.

You can test this yourself. Type some text, then ^U, then ^Y. This works because your shell uses libreadline or libeditline. Try this again in a "dumb" program like cat, or a shell without line editing like /bin/dash. ^U works, but ^Y does nothing (well, it lets you type ^Y in as much as you want).

Re:What typing ^D does on Unix (2009) by JdeBP on Wednesday September 07, 2016 @04:35AM (#12441671)
Actually, NAK in canonical mode is handled by the line discipline in the pseudo terminal device rather than by the emulator.