Stop handling exception that we do not expect
Now that we guard via hSupportsANSI this is not an exception that should occur. And if it occurs we'd rather crash, as reading of stdin can be broken after such an exception.master
parent
09c8e81095
commit
aabc498fdb
|
@ -452,10 +452,7 @@ main = B.mainFromCmdParser $ do
|
||||||
termWidthMay <- restore $ do
|
termWidthMay <- restore $ do
|
||||||
support <- Ansi.hSupportsANSI System.IO.stdin
|
support <- Ansi.hSupportsANSI System.IO.stdin
|
||||||
if support
|
if support
|
||||||
then try Ansi.getTerminalSize <&> \case
|
then fmap snd <$> Ansi.getTerminalSize
|
||||||
Left (_e :: IOException) -> Nothing
|
|
||||||
Right Nothing -> Nothing
|
|
||||||
Right (Just (_, w)) -> Just w
|
|
||||||
else pure Nothing
|
else pure Nothing
|
||||||
let stdoutCheckCount =
|
let stdoutCheckCount =
|
||||||
length
|
length
|
||||||
|
|
Loading…
Reference in New Issue