* `reset-prompt` multiple times cause multiline PROMPT redraw in the wrong place
@ 2017-12-01 10:04 Pika Mao
2017-12-01 10:16 ` Sebastian Gniazdowski
0 siblings, 1 reply; 2+ messages in thread
From: Pika Mao @ 2017-12-01 10:04 UTC (permalink / raw)
To: zsh-workers
[-- Attachment #1: Type: text/plain, Size: 532 bytes --]
Hello,
If I add a vim mode indicator to a multiline PROMPT, then the sequence
`^[i` (alt-i) will cause the prompt redraw in the wrong place.
The problem seems to be that `reset-prompt` is called multiple times in one
execution cycle.
Following is a minimal .zshrc:
```
zle-keymap-select() {
zle .reset-prompt
}
zle -N zle-keymap-select
zle-line-init() {
zle .reset-prompt
}
zle -N zle-line-init
bindkey -v
setopt promptpercent promptsubst
autoload -U promptinit
promptinit
PROMPT='%~$prompt_newline $KEYMAP >> '
```
Leo
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: `reset-prompt` multiple times cause multiline PROMPT redraw in the wrong place
2017-12-01 10:04 `reset-prompt` multiple times cause multiline PROMPT redraw in the wrong place Pika Mao
@ 2017-12-01 10:16 ` Sebastian Gniazdowski
0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Gniazdowski @ 2017-12-01 10:16 UTC (permalink / raw)
To: Pika Mao, zsh-workers
On 1 Dec 2017 at 11:04:30, Pika Mao (leomaoyw@gmail.com) wrote:
> Hello,
>
> If I add a vim mode indicator to a multiline PROMPT, then the sequence
> `^[i` (alt-i) will cause the prompt redraw in the wrong place.
>
> The problem seems to be that `reset-prompt` is called multiple times in one
> execution cycle.
I might have something related:
myfun() { sched -o +1 myfun; }
sched -o +1 myfun
It uses "-o" option that should help outputting to terminal. However the unexpected effect in this example is that new prompt is shown each execution (each second in this case).
--
Sebastian Gniazdowski
psprint /at/ zdharma.org
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-12-01 10:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-01 10:04 `reset-prompt` multiple times cause multiline PROMPT redraw in the wrong place Pika Mao
2017-12-01 10:16 ` Sebastian Gniazdowski
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).