Skip to content

Commit

Permalink
Move stderr of stty to pipe
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bradrn authored and supki committed Mar 20, 2022
1 parent d47596c commit 5e842a5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/System/Console/Terminal/Windows.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5e842a5

Please sign in to comment.