Prevent man, nano from Clearing Screen on Exit in Terminal.app
$ mkdir ~/.terminfo $ infocmp > ~/.terminfo/xterm-color-noclear.terminfo $ nano ~/.terminfo/xterm-color-noclear.terminfo # 1. Change 'xterm-color' on second line to 'xterm-color-noclear' # 2. Remove 'smcup' and 'rmcup' $ tic ~/.terminfo/xterm-color-noclear.terminfo $ export TERM=xterm-color-noclear # Add export line to .profile
More info at: Synologic’s Stop gnome-terminal screen clear, Fix Log’s Stop gnome-terminal screen clear, and The Shallow Sky’s Exorcising the Evil Alternate Screen.
Update
I had to turn this off since it was affecting ssh terminals. Will revisit.
$ nano Error opening terminal: xterm-color-noclear.
$ infocmp > ~/.terminfo/xterm-color-noclear.terminfo
$ nano ~/.terminfo/xterm-color-noclear.terminfo
# 1. Change ‘xterm-color’ on second line to ‘xterm-col…. is this one correct? I didnt see xterm color
Iff you’re still getting that error, I think this can solve it.
HTH