Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
861 views
in Technique[技术] by (71.8m points)

linux - Zsh menu completion causes problems after zle reset-prompt

I have following code in my .zshrc:

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

After triggering menu completion all items from menu, except highlighted one disappear after TRAPALRM triggers and when i keep navigating in menu zsh segvaults after a short time

Is there any fix or workaround for this?

EDIT: zsh version is 5.0.2 on Linux Mint 17

EDIT: i observe same thing on zsh version 5.0.7 on Gentoo

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...