Packages

Retrieve the terminal's size in rows and columns on all targets

Current section

Files

Jump to
term_size src term_size_ffi.erl
Raw

src/term_size_ffi.erl

-module(term_size_ffi).
-export([terminal_size/0]).
terminal_size() ->
case {io:rows(), io:columns()} of
{{ok, Rows}, {ok, Cols}} -> {ok, {Rows, Cols}};
_ -> {error, nil}
end.