Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Duplicating TRANSIENT_RPROMPT for left PROPMT?



When I enter a command the bottom part of my zsh PROMPT is not cleared

~
→ echo a
a- INSERT --
~
→
-- INSERT --

The unusual part of my prompt is the vi mode at the bottom of my screen.
Does anyone have thoughts on the best way to clear the prompt before the
command is entered?

Here is my zshrc:

bindkey -v
setopt prompt_subst

vim_ins_mode="-- INSERT --"
vim_cmd_mode=""
vim_mode=$vim_ins_mode

terminfo_down_sc=$terminfo[cud1]$terminfo[cud1]$terminfo[cuu1]$terminfo[cuu1]$terminfo[sc]$terminfo[cud1]$terminfo[cud1]
function zle-keymap-select {
  vim_mode="${${KEYMAP/vicmd/${vim_cmd_mode}}/(main|viins)/${vim_ins_mode}}"
  zle reset-prompt
}
zle -N zle-keymap-select

function zle-line-finish {
  vim_mode=$vim_ins_mode
}
zle -N zle-line-finish

PS1='%{$terminfo_down_sc$vim_mode$terminfo[rc]%}%~
→ '

Thanks, Jesse


Messages sorted by: Reverse Date, Date, Thread, Author