How can I avoid emacs (or vi) left on your screen after closing when using GNU screen?
In a regular bash session, if I type vi
or emacs -nw
and then I log out or pause them, I return to my shell unscathed (with the previous commands I typed still visible). The shell is intact as I have never run emacs
or vi
. In use GNU Screen
, however, after exiting, I still see vi / emacs doing what I was doing, forcing me to use screen scrolling or history to invoke even the last command I ran before starting emacs / vi. How do I turn off this mess? Is it possible?
source to share
An inseparable aspect is that vi / emacs uses your alternate curse terminal screen (a library that allows them to place characters at arbitrary positions on the terminal screen). (1) the program already uses the alternate terminal screen and by default does not create its own screen for programs that run inside it for access through curses.
However, you can enable it on screen with:
altscreen on
in the ~ / .screenrc file.
For details, see the screen display page.
source to share