In bash there are two environmental variables: COLUMNS
and LINES
that store the number of columns and rows for the terminal. I have been trying to obtain that information in Haskell.
Since unlike ruby Haskell's run-time doesn't calculate that by default, I resorted to calling stty size
. However, calling this command from Haskell with
readProcess "stty" ["size"] ""
results in the following run-time error:
readCreateProcess: stty "size" (exit 1): failed
What would be a good way to retrieve such information?