Closed
Description
OS Information
coder --version
: Coder v0.5.5-devel+97a95f1- OS image:
coder-dogfood/master/coder-dev-ubuntu
(Ubuntu 20.04.3 LTS)
Steps to Reproduce
- Run a command that tries to read a password from the terminal, e.g.
coder login
- While the password prompt is waiting for input, kill the program (e.g. by pressing Ctrl-C)
Expected
The program should exit and the terminal should be restored to the same state it was in before the command was run.
Actual
The terminal's "echo" flag remains disabled, which means you can't see what you're typing into the shell until you run a command like reset
to restore it.
Notes
Since we prompt for the password twice, if you make a typo entering it the first time then you're basically guaranteed to hit this bug, because the second prompt will keep asking for input until either the passwords match or the program is killed.
Of course, if we get a SIGKILL then there's nothing we can do to clean up, but we should be able to restore the terminal correctly if we receive any other signal.