aboutsummaryrefslogtreecommitdiff
path: root/pkg/terminal
diff options
context:
space:
mode:
authorAnton Tykhyy <atykhyy@gmail.com>2021-09-13 17:42:48 +0300
committerGitHub <noreply@github.com>2021-09-13 17:42:48 +0300
commitc23f81fab6183892a3565e6b2a818ad9db22421c (patch)
tree66d1ea48923e7710e84e72208fb82353987053fe /pkg/terminal
parent0f3d3bd21da0b67542c44c832f0e1642c5f639cf (diff)
downloadpodman-c23f81fab6183892a3565e6b2a818ad9db22421c.tar.gz
podman-c23f81fab6183892a3565e6b2a818ad9db22421c.tar.bz2
podman-c23f81fab6183892a3565e6b2a818ad9db22421c.zip
Fix #11444: remote breaks with stdout redirection
`setConsoleMode` should do nothing if the handle is not a terminal. The proposed change is [exactly what `golang.org/x/term/IsTerminal()` does on Windows](https://cs.opensource.google/go/x/term/+/6886f2df:term_windows.go). [NO TESTS NEEDED] Signed-off-by: Anton Tykhyy <atykhyy@gmail.com>
Diffstat (limited to 'pkg/terminal')
-rw-r--r--pkg/terminal/console_windows.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/terminal/console_windows.go b/pkg/terminal/console_windows.go
index 08e66cb3a..9a636d681 100644
--- a/pkg/terminal/console_windows.go
+++ b/pkg/terminal/console_windows.go
@@ -25,7 +25,7 @@ func setConsoleMode(handle windows.Handle, flags uint32) error {
var mode uint32
err := windows.GetConsoleMode(handle, &mode)
if err != nil {
- return err
+ return nil // not a terminal
}
if err := windows.SetConsoleMode(handle, mode|flags); err != nil {
// In similar code, it is not considered an error if we cannot set the