| ▲ | mikkupikku 13 hours ago | |||||||
> One implies the other. You turn echo off. Then you write asterisks. That's not how it works. Sudo turns off echo but otherwise keeps the terminal in it's normal cooked canonocal mode, meaning sudo only sees what you've entered after you hit enter. To print asteriks as you type requires putting the terminal in raw mode, which has the addition consequence of needing to implement shit like backspace yourself. Still a UX win worth doing, but it's pretty clear that skipping that and just disabling echo is an easier lazier implementation. | ||||||||
| ▲ | themafia 11 hours ago | parent [-] | |||||||
You're correct, but, the echo and canonical mode flags are literally in the same termios structure member. One is no more complicated to change than the other. You can also easily switch to character at a time read() which makes handling backspace, erase or kill exceedingly simple. I still doubt the claim the scheme employed by sudo was done because it "was easier." | ||||||||
| ||||||||