zsh-users
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: nirva@ishiboo.com (Danny Dulai), zsh-users@sunsite.auc.dk
Subject: Re: clear to end of display
Date: Sat, 18 Mar 2000 18:10:50 +0000	[thread overview]
Message-ID: <1000318181050.ZM1430@candle.brasslantern.com> (raw)
In-Reply-To: <Liam.953371133.732511.28294.1757553174@fizz>
In-Reply-To: <Liam.953376870.346679.24948.1537985050@fizz>

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


  reply	other threads:[~2000-03-18 18:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-18  9:18 Danny Dulai
2000-03-18 10:54 ` clear to end of display / clear to end of line Danny Dulai
2000-03-18 18:10   ` Bart Schaefer [this message]
2000-03-18 22:55     ` clear to end of display Danny Dulai
2000-03-19  3:50       ` Bart Schaefer
2000-03-19  7:08         ` Danny Dulai
2000-03-19  7:49           ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1000318181050.ZM1430@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=nirva@ishiboo.com \
    --cc=zsh-users@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).