zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Zang <zealot0630@gmail.com>
Cc: zsh-workers@zsh.org
Subject: Re: ZLE got wrong prompt line size, resulting redisplay eats lines when called
Date: Mon, 24 Oct 2022 10:20:56 +0200	[thread overview]
Message-ID: <CAHYJk3ShbpVYkzmQpPPEP9bUGWzV-DzMjLxO3HAEo8oSEf+beQ@mail.gmail.com> (raw)
In-Reply-To: <CAOrge3rQo1L3bZU_5VPapJGbm5j85cMeWYhaYomozsr1qGxdMA@mail.gmail.com>

On 10/24/22, Zang <zealot0630@gmail.com> wrote:
> 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.

If you're printing characters that move the cursor, it is up to you to
tell zsh about it. In this case I suppose you could surround the
entire construct with %{ %}.

-- 
Mikael Magnusson


  reply	other threads:[~2022-10-24  8:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-24  7:27 Zang
2022-10-24  8:20 ` Mikael Magnusson [this message]
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=CAHYJk3ShbpVYkzmQpPPEP9bUGWzV-DzMjLxO3HAEo8oSEf+beQ@mail.gmail.com \
    --to=mikachu@gmail.com \
    --cc=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).