helper/password: interrupt should exit readline
This commit is contained in:
parent
e6f96f71da
commit
2917e6be2f
|
@ -50,6 +50,13 @@ func readline(f *os.File) (string, error) {
|
|||
break
|
||||
}
|
||||
|
||||
// ASCII code 3 is what is sent for a Ctrl-C while reading raw.
|
||||
// If we see that, then get the interrupt. We have to do this here
|
||||
// because terminals in raw mode won't catch it at the shell level.
|
||||
if buf[0] == 3 {
|
||||
return "", ErrInterrupted
|
||||
}
|
||||
|
||||
resultBuf = append(resultBuf, buf[0])
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue