I was wondering about the functionality of the clear (https://invisible-island.net/ncurses/man/clear.1.html) command, that I can evoke with CtrlL in my Terminal.app on macOS.
When executed, it should move my cursor to the top of the screen - what it does. That's great. But it has a side effect as well: It creates a whole lot of white space (depending on the screen size) on top of the command. For example look at this command line history:
➜ ~ some command
command
output
➜ ~ clear
➜ ~ # the input line is now on top; but there is a lot of whitespace in the history as well
This is kind of bloating my command line history, when I scroll back. So I'm wondering, why is this white-space on top created?