5 ms·
> Writing a shell script that wants to read passwords? cat a file which disables input echoing. After invoking readline, cat a different file to re-enable it. "
by aap_ 10y ago
> Writing a shell script that wants to read passwords? cat a file which disables input echoing. After invoking readline, cat a different file to re-enable it. "Feature".
Sending control characters to the tty won't do that. Input echo is done in the kernel and you need an ioctl to disable it.
- MaulingMonkey 10y ago> Sending control characters to the tty won't do that Several terminals have support for, and escape codes to manage, local input echo: http://www.vt100.net/docs/vt102-ug/chapter5.html#S5.5.2.13 http://www.vt100.net/docs/vt102-ug/chapter5.html#S5.5.2.13 If the kernel is operating under the assumption that the device is operating under local input echo mode (e.g. the ioctl has already been invoked to disable kernel input echo, as the terminal is assumed to be handling it), sending escape codes to the tty will do that. EDIT: In case my air quotes around "Feature" weren't enough of a hint, I'm not actually recommending anyone do this.