top and termcap

less has an "-X" switch that "disables sending the termcap initialization and deinitialization". This avoids the content being removed on leaving.
Now the top command has developed the same annoying behaviour. What's the switch here?
 
less has an "-X" switch that "disables sending the termcap initialization and deinitialization". This avoids the content being removed on leaving.
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.

Now the top command has developed the same annoying behaviour. What's the switch here?
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?

And: Looking at the most up-to-date man page for term, there is no such switch.
 
Have you installed misc/terminfo-db on your system?

src: 61f66a1f4403fded9aae14d890ad96914a3c0bc1
From this commit, now ncurses(3) supports terminfo along with termcap, and terminfo is preferred to termcap.

Uninstalling terminfo-db, now it seems that termcap is used instead of terminfo at least for me with xterm-256color terminal, and now I see the -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.

Note that sysutils/tmux depends on devel/ncurses instead of ncurses that comes from the base system, and I guess that would make some changes so that even if I removed terminfo-db, the content got removed after leaving top(1), less(1), vi(1), etc. inside of tmux. Maybe terminfo is used anyway instead of termcap.
 
Back
Top