Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
ZLE got wrong prompt line size, resulting redisplay eats lines when called
- X-seq: zsh-workers 50831
- From: Zang <zealot0630@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: ZLE got wrong prompt line size, resulting redisplay eats lines when called
- Date: Mon, 24 Oct 2022 15:27:37 +0800
- Archived-at: <https://zsh.org/workers/50831>
- List-id: <zsh-workers.zsh.org>
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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author