implement isatty
rearrange things a bit
implement getting terminal size