LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   vim doesn't clear screen inside of screen (https://www.linuxquestions.org/questions/linux-software-2/vim-doesnt-clear-screen-inside-of-screen-777534/)

eddified 12-22-2009 04:16 PM

vim doesn't clear screen inside of screen
 
I have a question about vim and scrollback.
So when i exit vim, I'm used to vim usually erasing all evidence of it having ever run, and returning to the commandline with the previous command right above it, like this:
[eddie@db1 ~]$ vim
[eddie@db1 ~]$

ie, you can see that I ran vim, but you can't see any of the vim windows or anything, because when I exited, vim erased all of itself, so now all you see is the command I used to get into it.

HOWEVER, now that I'm using screen, and running vim within that, vim doesn't erase itself when I exit, so it muddies up my terminal scrollback with a bunch of old vim windows etc.

Any ideas how i can get it to work how I'm used to within screen, that is to say, when I exit vim, vim will clear up all characters that it placed into the terminal?

rweaver 12-23-2009 10:59 AM

Sounds like a term/termcap issue, what distribution are you using and what term is your client reporting in screen vs out of screen.

eddified 12-24-2009 12:49 PM

I'm using putty from windows and remotely logging into the linux box over the internet.
Terminal-type string is xterm

[eddie@db1 beyond]$ cat /proc/version
Linux version 2.6.18-128.el5 (mockbuild@builder10.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-44)) #1 SMP Wed Jan 21 10:41:14 EST 2009

dickey 01-03-2010 02:39 PM

clearing screen inside screen
 
The behavior is configurable:

man screen:

altscreen on|off

If set to on, "alternate screen" support is enabled in virtual termi-
nals, just like in xterm. Initial setting is `off'.

eddified 01-04-2010 10:44 AM

Worked perfectly!

Many thanks.


All times are GMT -5. The time now is 11:34 PM.