Is there some way clear the terminal but instead of leaving the prompt at the top of the screen leaves it in the middle? It looks like clear
basically ignores all command-line parameters.
I thought there would be some way to do this with tput
but can't find one.
Best Answer
You could use
tput
to move the cursor to a given line in the screen, e.g.,to move it to the twelfth line (values count from zero).
Along the same lines, you could use
tput
to clear from that position to the end of the screen, using theed
capability. Combining,might be what was wanted.
If you want to go to the halfway mark on the screen, the first number returned by
is (on most systems) the number of rows of the screen. Adding that to the command:
The
clear
program differs fromtput ed
:Caveat: on some platforms
tput ed
may not work due to problems fixed long ago. In those cases, upgrading your curses/ncurses configuration will fix the problem.