[r, c] = terminal_size()
terminal_size() returns a vector with size of the terminal window in characters (rows and columns).
terminal_size()