Adjust the order of TTY restoration on Windows.

Normal commands no longer produce unsupported escape sequences. This
addresses #798.
This commit is contained in:
Qi Xiao 2019-03-14 21:14:39 +00:00
parent 150ee696a6
commit 3f73331ba0

View File

@ -34,8 +34,8 @@ func setup(in, out *os.File) (func() error, error) {
return func() error {
return util.Errors(
windows.SetConsoleMode(hIn, oldInMode),
restoreVT(out),
windows.SetConsoleMode(hOut, oldOutMode),
restoreVT(out))
windows.SetConsoleMode(hIn, oldInMode))
}, util.Errors(errSetIn, errSetOut, errVT)
}