I often view files using less and want to remember what i have just seen in the file. However when I quit less by pressing the q key my xterm window removes the page of less showing the file and only shows my command prompt.
How do I keep the less output on my terminal when I quit?
less -X
Use the -X option from the less man page described below:
Actually, if you are using xterm (rather than some other program), the choice of whether to honor alternate-screen escape sequences can be done readily using a menu selection Enable Alternate Screen Switching (or resource setting). The
less
option does not apply to other programs such asvi
.In the manual, this is the titeInhibit, named after the termcap settings
and in the FAQ, this is Why doesn't the screen clear when running vi?.