From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8735 invoked from network); 18 Mar 2000 18:11:22 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 18 Mar 2000 18:11:22 -0000 Received: (qmail 28424 invoked by alias); 18 Mar 2000 18:11:07 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2973 Received: (qmail 28406 invoked from network); 18 Mar 2000 18:11:05 -0000 From: "Bart Schaefer" Message-Id: <1000318181050.ZM1430@candle.brasslantern.com> Date: Sat, 18 Mar 2000 18:10:50 +0000 In-Reply-To: Comments: In reply to nirva@ishiboo.com (Danny Dulai) "clear to end of display" (Mar 18, 9:18am) References: In-Reply-To: Comments: In reply to nirva@ishiboo.com (Danny Dulai) "Re: clear to end of display / clear to end of line" (Mar 18, 10:54am) X-Mailer: Z-Mail (5.0.0 30July97) To: nirva@ishiboo.com (Danny Dulai), zsh-users@sunsite.auc.dk Subject: Re: clear to end of display MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Mar 18, 9:18am, Danny Dulai wrote: } Subject: clear to end of display } } Every time ZLE prints the prompt, I get a ^[[K (erase display) printed out. } It occurs on the character right before the prompt is printed. If I } unsetopt zle, it stops printing, so ZLE is probably at fault. [In another message] } Its also printing out a ^[[K at the end of the prompt. i thought the %E was } supposed to clear to end of line. I have no %E and yet its still generating } this esc seq to clear the line. What you should be seeing is a clear-to-end-of-display before the prompt is printed, and a clear-to-end-of-line after it. It's suspicious that you get the same thing both times, so the termcap/terminfo description of your terminal may be messed up. If what you're actually getting is clear-screen-and-home-cursor, termcap/terminfo is _badly_ messed up. The %E sequence is for use in prompts that move the cursor around inside %{...%} blocks and need to erase lines that may be above the prompt. What's the problem with having a clear-eol after the prompt? [Back in the first message] } I'm wondering why this happens, and how can I turn it off. Bash does not } exhibit this havior. I believe this has to do with the always_last_prompt option -- the code that prints the prompt wants to be sure that there's a clean slate below the prompt where it can display completion listings. However, it's a bit too aggressive; it performs the clear-eod whenever it's "safe" to do so (that is, whenever there's no completion listing there already that needs to continue to be seen) and not just whenever it's necessary to do so (which it -almost- never is when always_last_prompt is not set). The problem is with that -almost-. The following patch makes zle use clear-eod less aggressively, but I'm not confident that it won't leave garbage characters visible when some part of the completion system is drawing on the screen. I don't *think* there are any problems, because the completion list code prints its own clear-eod (at least in 3.1.6+), but only Geoff and Sven would know for certain. It may also be that there's a better way to do this; the change below makes prompt display slightly less efficient by causing it to emit a clear-eol (or a string of spaces if the terminal can't clear-eol) after each line it prints (that's the effect of cleareol = 1). That shouldn't make much difference if you don't have a multi-line prompt. The "Index" line is relative to the 3.1.6 sources, but this will also apply to Src/zle_refresh.c in 3.0.7. Note to zsh-workers, I don't think we should include this patch "officially" until at least Geoff has had a chance to comment on it. Index: Src/Zle/zle_refresh.c =================================================================== @@ -333,7 +333,7 @@ tsetcap(TCUNDERLINEEND, 0); if (!clearflag) { - if (tccan(TCCLEAREOD)) + if (tccan(TCCLEAREOD) && isset(ALWAYSLASTPROMPT)) tcout(TCCLEAREOD); else cleareol = 1; /* request: clear to end of line */ -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com