How to hide fullscreen CLI program output in xterm on FreeBSD?
FreeBSD's termcap definition for "xterm" omits the alternate-screen escape sequence. That's been discussed here before. You could do some workaround such as (since they left the rxvt
entry alone):
#!/bin/sh
TERM=rxvt tput ti
less "$@"
TERM=rxvt tput te
which will "work" since rxvt uses the xterm escape sequence for this case. Simply setting TERM=rxvt
in your environment will not give good results, but this piece is useful.
Alternatively, you could modify /etc/termcap
and recompile the terminal database. For reference, here's a link to the change which removed the alternate-screen:
revision 200503 by dougb, Mon Dec 14 07:18:31 2009 UTC
The change comments
Add some example xterm*-clear entries to the termcap files to make it easier for people to enable that behavior.
but the drawback to that is that (again) you wouldn't be able to use this in your shell if you wanted to pass it to remote machines (other than FreeBSD of course). None of those "xterm*-clear" entries will be in Ubuntu.
Further reading:
- cap_mkdb - create capability database (tool used to compile the terminal database)
- GNU Screen: Strange TERMCAP when using -d -m (mentions the FreeBSD changes)