Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: ZLE got wrong prompt line size, resulting redisplay eats lines when called
On 10/24/22, Zang <zealot0630@xxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author