cli-clear
cli-clear copied to clipboard
Check if current process is in TTY
This will ensure we are in a TTY (on none tty environments, getWindowSize
is not available)
Why set to 3 when not a TTY? Also, there's window-size.
Hey :)) Actually I don't remind as this is a pretty old PR :D But I think it was because of windows terminal compatibility which TTY is not available. Feel free closing if not appreciate. Ah, maybe it was because we don't know how many lines that terminal has without access to TTY so 3 just is a fallback to simulate a soft cls.
I wonder if it should do anything in a non-TTY on Windows.