General philosophical comment: I hate programs that do that. It messes with scrolling back to see the history; and since today de-facto all terminal emulators allow a lot of scroll back, it makes my workflow harder. I understand that there are people who love it, because they use their terminals differently.less
has an "-X" switch that "disables sending the termcap initialization and deinitialization". This avoids the content being removed on leaving.
On my FreeBSD machine (running 13.3), it has not developed that behavior; my $TERM is xterm-256color. Maybe you are running a newer version?Now thetop
command has developed the same annoying behaviour. What's the switch here?
-X
option for less(1) is no longer required to achieve that behavior. You'll not need to modify the source code for top(1), too.