I'm working on a Ubuntu Linux machine and I'm looking for a way to get the xterm to scroll when things are cleared rather than clearing the screen and showing the previous contents.
This may not make sense so a couple examples might. When I run vim in an xterm and hit ctrl-Z it wipes the screen and shows me the command prompt that I used to run the command. Instead I'd like to still be able to see what I was editing. Or when reading a man page I find the part I was looking for so I hit q to drop out and the screen clears and shows the command I used to launch that, but the information I wanted from the man page is gone.
I found that setting the TERM environment variable to vt100 gets me the scrollback that I want but doing that has drawbacks such as disabling colors and key actions in editors that look at TERM. For example in vim colors don't work and Page Down key no longer pages.
Is there a way to get both the scrollback and the features of TERM=xterm?