zsh-workers
 help / color / mirror / code / Atom feed
From: Zang <zealot0630@gmail.com>
To: zsh-workers@zsh.org
Subject: ZLE got wrong prompt line size, resulting redisplay eats lines when called
Date: Mon, 24 Oct 2022 15:27:37 +0800	[thread overview]
Message-ID: <CAOrge3rQo1L3bZU_5VPapJGbm5j85cMeWYhaYomozsr1qGxdMA@mail.gmail.com> (raw)

Step to reproduce:

1. Run zsh in clean mode
```
zsh -d -f -i
```

2. Set PROMPT, fill line with dash, then carriage return, fill line
with dash again
```
PROMPT="${(pl:${COLUMNS}::-:)}$terminfo[cr]\
${(pl:${COLUMNS}::-:)}$terminfo[cr]\

%# "
```

By using this PROMPT, we filled the first line of the PROMPT with
dashes twice, it takes only a single line.
But it seems that ZLE doesn't understand carriage return, it considers
that the PROMPT takes multiple lines.

3. Bind ctrl-X to redisplay
```
bindkey "^X" redisplay
```

4. By pressing ctrl-x, one will experience the bug, that PROMPT is
eating lines from previous command outputs.


             reply	other threads:[~2022-10-24  7:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-24  7:27 Zang [this message]
2022-10-24  8:20 ` Mikael Magnusson
2022-10-24  8:38   ` Zang

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=CAOrge3rQo1L3bZU_5VPapJGbm5j85cMeWYhaYomozsr1qGxdMA@mail.gmail.com \
    --to=zealot0630@gmail.com \
    --cc=zsh-workers@zsh.org \
    /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).