Get terminal window height and width without ncurses dependency.