From 5e842a53766f4d78e19e585c3590bcc01dd2a525 Mon Sep 17 00:00:00 2001 From: Brad Neimann Date: Thu, 11 Jul 2019 17:08:16 +1000 Subject: [PATCH] Move stderr of stty to pipe If stderr is left as its default value, any error messages arising from stty are output to the stderr of the program calling `size`, causing strange messages if stty fails. --- src/System/Console/Terminal/Windows.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/System/Console/Terminal/Windows.hs b/src/System/Console/Terminal/Windows.hs index 962afd7..87aa1bf 100644 --- a/src/System/Console/Terminal/Windows.hs +++ b/src/System/Console/Terminal/Windows.hs @@ -42,6 +42,7 @@ size = do let stty = (shell "stty size") { std_in = UseHandle stdin , std_out = CreatePipe + , std_err = CreatePipe } (_, mbStdout, _, rStty) <- createProcess stty exStty <- waitForProcess rStty