1

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?

xzhu
  • 5,675
  • 4
  • 32
  • 52

1 Answers1

2

I would try the System.Console.Terminal.Size package, which in turn is based on Get Terminal width Haskell

Community
  • 1
  • 1
Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105