Zsh menu completion causes problems after zle reset-prompt

后端 未结 2 1151
太阳男子
太阳男子 2020-12-16 18:41

I have following code in my .zshrc:

TMOUT=1
TRAPALRM() { zle reset-prompt }

After triggering menu completion all items from menu, except hi

2条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-16 19:42

    I found this workaround, to basically prevent calling "reset-prompt" when in a menu selection :

    TRAPALRM() {
        if [ "$WIDGET" != "complete-word" ]; then
            zle reset-prompt
        fi
    }
    

    Note that complete-word may be different for you; I found it with an echo $WIDGET in the TRAPALRM call.

提交回复
热议问题