zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: zsh-workers@sunsite.dk
Subject: Re: Zsh clears prompt line. Feature or bug?
Date: Fri, 08 Apr 2005 10:43:44 +0200	[thread overview]
Message-ID: <4374.1112949824@trentino.groupinfra.com> (raw)
In-Reply-To: <1050407225513.ZM17729@candle.brasslantern.com>

Bart wrote:
> 3.23. How do I prevent the prompt overwriting output when there is no newline?

This reminds me. I've been using the following modification to the print
80 spaces solution:

  precmd() { print -n "${(l.$COLUMNS.)}\e7${(l.$COLUMNS..\b.)}\e8\015" }

That's 80 spaces, save cursor position, 80 backspaces, restore cursor.
The \015 is not part of it: that resets the font.

On at least xterm, pterm and dtterm, this solves the problem with
selecting text. The problem with just printing 80 spaces was that if you
then selected the last line with the mouse, it would select the spaces
instead of a newline. The problem with Bart's $'\e[6n' solution is that
the key buffer is lost so if you had already started typing the next
command, it'd be lost when precmd() ran.

Oliver



  reply	other threads:[~2005-04-08  8:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-06 18:59 Joel Kaasinen
2005-04-07 17:27 ` DervishD
2005-04-07 18:01   ` Joel Kaasinen
2005-04-07 18:15     ` DervishD
2005-04-07 22:55       ` Bart Schaefer
2005-04-08  8:43         ` Oliver Kiddle [this message]
2005-04-08 10:09           ` Bart Schaefer
2005-04-08 10:15             ` Bart Schaefer
2005-04-08 11:00             ` Oliver Kiddle
2005-04-08 15:12               ` Bart Schaefer
2005-04-08 15:29                 ` DervishD
2005-04-08 16:23                   ` Bart Schaefer
2005-04-08 17:47                 ` Oliver Kiddle

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=4374.1112949824@trentino.groupinfra.com \
    --to=okiddle@yahoo.co.uk \
    --cc=zsh-workers@sunsite.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).