Hi. The behavior you've described below doesn't strke me as odd. I get
the same results in a naked xterm, without tmux.

1. command to produce output (I used "man man | cat")
2. shrink the window so it is smaller, vertically
3. Resize it to its original form
4. The output reappears with prompt after it.

In both cases, the cause is also (presumably) the same: clear
(typically) works by simply moving the cursor to the top of the current
screen, and then "erasing" from the current cursor position to the
bottom of the screen. In many implementations (including xterm and
tmux's), this causes all the lines following not to "exist" any more if
they no longer appear in the terminal. When you shrink down, you cause
them not to "exist". When you regrow, the terminal usually prefers to
display "existing" lines, rather than create wholly new ones; this
results in using some lines from backhistory that appear above the
prompt, rather than creating new blank lines.

In both a "true" terminal emulator and in tmux, if you actually want to
clear backhistory lines as well as just the lines that are visible, you
need to do it in a terminal-dependent way (after the visible-lines
"clear"). The way to do that in tmux is to use the "clearhist" command.
Then it's forced to create new lines, because there are no existing
lines in the backhistory.

I realize how it might seem like a bug; in general it's good to think of
anything that is "surprising behavior" as a bug, but in this case, it's
hard to say whose behavior should change: from tmux's point of view, no
one told it to "clear"; someone only told it to erase all the visible
lines starting at a certain location on the screen. From the "clear"
command's point of view, if it had a way to say more precisely to
"clear", it would, but there is unfortunately no portable way to do this.

-mjc

(09/12/2010 09:47 AM), Raghavendra D Prabhu wrote:
> Hi,
> 
> I am seeing an issue when resizing the client(urxvt). Text cleared
> reappears.
> 
> Steps to reproduce:
> 1. ls (or any command to produce output)
> 2. clear the screen with clear
> 3. Now tile the window horizontally by opening any other applications 
> 4. Now close the newly opened application so that urxvt is now untiled.
> 5. The ls output reappears with prompt after it in that window.
> 
> Let me know if more information is needed. This happens with other
> terminals also(xterm).
> 
> -------------------
> Raghavendra
> 
> ------------------------------------------------------------------------------
> Start uncovering the many advantages of virtual appliances
> and start using them to simplify application deployment and
> accelerate your shift to cloud computing
> http://p.sf.net/sfu/novell-sfdev2dev
> _______________________________________________
> tmux-users mailing list
> tmux-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/tmux-users


-- 
Micah J. Cowan
http://micah.cowan.name/

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to