Well, it still behaves the same for me in xterm. vim overwrites what is
in the terminal, it doesn't push it into the scrollback.
There is no way for any application to control what the terminal keeps
around in the scrollback, it's entirely up to the terminal. Well, aside
from the "clear scrollback" escape sequence on the Linux console.
Whatever configuration you have must mean that whatever screen uses to
clear the terminal usually pushes things into the scrollback, if we can
figure out what that is and it isn't too complicated we might be able to
do it in tmux, but it will not work in all cases and definitely not with
panes.
I'm not wild about the idea of using a bunch of newlines instead of
clear in terminfo. If I can reproduce it would help... I'll try rxvt if
I have time when I get home.
Did you try xterm itself? TERM is set to xterm?
Can you run screen inside script, do ls -la so it scrolls then run vim,
then exit and send me the typescript file?
On Fri, Mar 09, 2012 at 10:40:07AM -0800, Gustavo Baratto wrote:
>Hi Nicholas...
>Yes, I'm talking about the terminal scrollback, not tmux/screen history.
>The use case I'm describing is a tiny bit different than yours: No need to
>exit vi.*
>Just type 'ls -la', open a file with 'vi', then scrollback your terminal
>before you exit 'vi'.
>You'll see that everything that was on the screen is overwritten when
>using tmux.
>When using screen, the content of the terminal before I enter 'vi' is
>moved up, and nothing is lost and I can access the content just by
>scrolling up the mouse.
>Basically, I don't want to lose anything that was written to the terminal.
>I don't have*"altscreen off" in my .screenrc, but the default seems to be
>off.
>I also don't have either*.Xresources or .Xdefaults in my home directory,
>my screen version is "4.00.03jw4 (FAU) 2-May-06", and tmux version 1.5
>I'm on ubuntu oneiric (10/11), using konsole, but I tried gnome-terminal,
>aterm, etc all emulating xterm (I did try rxvt as well). Same behavior.
>Thanks a bunch for the help Nicholas :)
>g.
>On Thu, Mar 8, 2012 at 11:11 PM, Nicholas Marriott
><[1]nicholas.marri...@gmail.com> wrote:
>
> Are you still talking about the terminal scrollback rather than internal
> tmux/screen history?
>
> Because this is not the case for me, even if I add "altscreen off" to
> your .screenrc below, screen behaves like I would expect - if I do ls
> -la then vi then exit vi and scroll up into the terminal scroll buffer,
> what is in the scrollback buffer is whatever screen happened to scroll
> off the screen, usually the output of ls cut off (so if I have a two
> line terminal and ls displays four lines a,b,c,d then a and b are left
> in the scrollback).
>
> What xterm version are you using on what platform? What is in your
> .Xresources/.Xdefaults? What screen version?
>
> I take it TERM is set to xterm?
>
> On Thu, Mar 08, 2012 at 05:57:18PM -0800, Gustavo Baratto wrote:
> > * *Hi Nicholas...
> > * *Try running "ls -la", then opening any file with 'vi'.
> > * *When 'vi' starts, the result of 'ls -la' get overwritten in tmux.
> > * *With screen or the plain terminal, the result of 'ls -la' get moved
> up but
> > * *not overwritten, so I never lose what was printed on the terminal.
> > * *This is my .tmux.conf:
> > * *
> > * *set -g history-limit * * * 20
> > * *set -g set-titles * * * * *on
> > * *set -g set-titles-string * '[#I:#W:#T]'
> > * *set -g status-justify * * *right *
> > * *set -g status-keys * * * * vi
> > * *set -g status-left * * * * '#[fg=red][#I:#W]'
> > * *set -g status-left-length *50
> > * *set -g status-left-attr * *"none"
> > * *set -g status-right * * * *''
> > * *set -g status-right-length 1
> > * *set -g status-bg * * * * * *'yellow'
> > * *set -g default-terminal * * *"screen-256color"
> > * *set -g terminal-overrides *'*:smcup@:rmcup@'
> > * *setw -g window-status-current-format
> > * **'#[fg=red,underscore,blink][#I:#W#F]'
> > * *setw -g window-status-attr * * * * * *dim
> > * *setw -g window-status-format * * * * *'#I:#W#F'
> > * *setw -g mode-keys * * * * * * * * * * vi
> > * *setw -g mode-mouse * * * * * * * * * off*
> > * *setw -g alternate-screen * * * * * * *off
> > * *
> > * *And this is my .screenrc:
> > * *
> > * *termcapinfo xterm ti@:te@
> > * *defscrollback 10
> > * *
> > * *On Thu, Mar 8, 2012 at 5:32 PM, Nicholas Marriott
> > * *<[1][2]nicholas.marri...@gmail.com> wrote:
> >
> > * * *I don't really understand what you are asking.
> >
> > * * *tmux has no control over what goes into the terminal scrollback
> and
> > * * *when, nor does screen, it's entirely up to the termina