1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #24961 from jstarks/vt_th2_fix

Windows: Restore console mode on set mode failure
This commit is contained in:
Vincent Demeester 2016-07-25 09:49:34 +02:00 committed by GitHub
commit bff9a0556f

View file

@ -44,9 +44,11 @@ func StdStreams() (stdIn io.ReadCloser, stdOut, stdErr io.Writer) {
if err = winterm.SetConsoleMode(fd, mode|enableVirtualTerminalInput); err != nil {
emulateStdin = true
} else {
winterm.SetConsoleMode(fd, mode)
vtInputSupported = true
}
// Unconditionally set the console mode back even on failure because SetConsoleMode
// remembers invalid bits on input handles.
winterm.SetConsoleMode(fd, mode)
}
fd = os.Stdout.Fd()