Currently when I am not using screen utility, I am able to see the VIM content wiped out of the display when I quit VIM.
However when I am using GNU Screen utility and opening a file in one of the screen window and closing it, I can see the trailing file content on the display. It’s not wiping out the file content from the display the way it does when I am not using GNU Screen.
I found the below post where it has been discussed without GNU Screen.
How to set the bash display to not show the vim text after exit?
In my case, in both the scenario [with and without GNU Screen] the Terminal Type is “xterm”. But the behavior is different when I close a VIM file.
Kindly help.
Best Answer
GNU screen supports the xterm alternate-screen feature using the
altscreen
setting in your .screenrc file. According to the manual:A quick check shows that
screen
is actually simulating the feature, because it clears and/or restores the screen contents itself without sending the control sequence used by xterm. Thescreen
feature works whether or not the actual terminal (or its terminal description) supports the alternate screen feature. You can test this by settingTERM
to "vt100" before runningscreen
.You can read more about the alternate screen feature in the xterm FAQ Why doesn't the screen clear when running vi?