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

So ^U will let a partial password linger in memory longer than it needs to if you use it as suggested by the GP?


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


Actually, NAK in canonical mode is handled by the line discipline in the pseudo terminal device rather than by the emulator.


No, I don't think so. Not unless you are accustomed to typing your password directly into the terminal prompt. Kill buffers don't pass from one application to another and they don't all behave the same in every context, either.

(For example, if I type some stuff and then ^U to kill the password buffer at an SSH password prompt, typing ^Y after that seems to put the whole process in the background. Not sure what that's intended to do, but subsequent ^Y presses don't retrieve the password into the shell prompt...)


In canonical mode, EM is the usual "delayed suspend" special character.




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

Search: