Is there a way to get an xterm to scroll to clear the screen?

Solution 1:

This command will turn the effect on for any XTerms started later:

echo XTerm*VT100.TiteInhibit: True|xrdb -merge

From xterm(1):

titeInhibit (class TiteInhibit)

Specifies whether or not xterm should remove ti and te termcap entries (used to switch between alternate screens on startup of many screen-oriented programs) from the TERMCAP string. If set, xterm also ignores the escape sequence to switch to the alternate screen. Xterm supports terminfo in a different way, supporting composite control sequences (also known as private modes) 1047, 1048 and 1049 which have the same effect as the original 47 control sequence. The default for this resource is “false.”

Put the line XTerm*VT100.TiteInhibit: True in your ~/.Xresources file if you want the effect to be permanent.

Solution 2:

One thing you can do if you use less (also if it's the pager you're using for man) is to set LESS=X (plus whatever other defaults you have) in your ~/.bashrc file. This will cause less to leave what it was displaying on the screen when you exit.