mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Simplification in the goroutine that restore the terminal state on SIGINT
This commit is contained in:
parent
7d0ab3858e
commit
b306a60738
1 changed files with 3 additions and 5 deletions
|
@ -65,11 +65,9 @@ func setRawTerminal() (*term.State, error) {
|
|||
c := make(chan os.Signal, 1)
|
||||
signal.Notify(c, os.Interrupt)
|
||||
go func() {
|
||||
for _ = range c {
|
||||
_ = <-c
|
||||
term.Restore(int(os.Stdin.Fd()), oldState)
|
||||
log.Printf("\nSIGINT received\n")
|
||||
os.Exit(0)
|
||||
}
|
||||
}()
|
||||
return oldState, err
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue