I'm on a linux machine and what I need is a sh script/command to be able to remove all contents from a terminal window (even what appears as the contents of PS1 variable) and remove the ability to scroll.Basically I need a blank terminal where you just see a program's output and you have no ability to scroll. Just like what nano command does.I tried various methods, like clear, reset, tput reset and echo -en \\ec but all of them (although clearing almost all the content) leaves the prompt text intact, which I don't want. I also need not be able to scroll up or down in the terminal.A solution could be to print some newline characters which amounts to the height of the terminal, but that way I could scroll up and eventually I'd see the prompt text, so this in combination with disabling scrolling/scrollbar could be a solution, but I don't know how to do it, and even then, I don't see this as a 'clean' solution.Thanks.
Clearing terminal window output completely (even prompt text)?
prompt;gnome terminal
all of them […] leaves the prompt text intactUntrue.  They all clear the screen (some of them — beware! — doing more than just that).  Then your shell comes along, after they have finished running, and prints another prompt.  If you wanted a program to run on a clear screen, you should have run it in the same command line, or script, where you ran the clear command, before the interactive shell prompts for another command line to be input.clear ; some_programwhat nano command doesnano is in the class of full screen TUI programs, alongside programs such as mc, less, nvim, tin, and so forth.  What such programs do is use the termcap/terminfo database to obtain the control sequences for switching the terminal into and out of cursor addressing mode, which they emit to the terminal when they start up and tear down their user interfaces.  Normally, the terminal is in scrolling mode.For some terminal types, switching into cursor addressing mode under the covers switches to an alternate screen buffer, and the alternate screen buffer has no scrollback and hence no scroll bar widgets.  This behaviour is not guaranteed for all terminal types, because not all terminal types even have an alternate screen buffer.Further readinghttps://unix.stackexchange.com/a/336635/5132https://superuser.com/a/715563/38062https://stackoverflow.com/a/39302351/340790https://unix.stackexchange.com/a/243320/5132