The function of returning the contents of the screen after starting the full-screen vs application, leaving the contents there, does not apply to vi, but to the terminal emulator. The function that you want to enable to return to the previous text is often called "altscreen". If you use xterm as a terminal emulator, this is the default behavior. However, if you are using the GNU screen inside xterm (or another terminal), you need to add the line
altscreen on
to the ~ / .screenrc file. Other terminals that support this feature will have other mechanisms for turning it on and off.
source
share