termsize

Build Status

Reliably get the terminal window size

Install

In your mix.exs:

defp deps do
  [
    { :termsize, "~> 1.0.1" }
  ]
end

Then run mix deps.get.

Usage

Make sure you add termsize to your applications:

def application do
  [applications: [:logger, :termsize]]
end
IO.puts TermSize.get # {151, 32}

{cols, rows} = TermSize.get
IO.puts cols # 151
IO.puts rows # 32

License

MIT © Juan Soto