zle reset-prompt 后 Zsh 菜单完成导致问题 [英] Zsh menu completion causes problems after zle reset-prompt
问题描述
我的 .zshrc 中有以下代码:
I have following code in my .zshrc:
TMOUT=1
TRAPALRM() { zle reset-prompt }
触发菜单完成后,菜单中的所有项目,除了突出显示的一项在 TRAPALRM
触发后消失,并且当我在短时间内继续在菜单 zsh segvaults 中导航时
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?
Linux Mint 17 上的 zsh 版本为 5.0.2
zsh version is 5.0.2 on Linux Mint 17
我在 Gentoo 上的 zsh 版本 5.0.7 上观察到同样的事情
i observe same thing on zsh version 5.0.7 on Gentoo
推荐答案
我找到了这个解决方法,基本上可以防止在菜单选择时调用reset-prompt":
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
}
请注意,complete-word
可能对您有所不同;我在 TRAPALRM
调用中使用 echo $WIDGET
找到了它.
Note that complete-word
may be different for you; I found it with an echo $WIDGET
in the TRAPALRM
call.
这篇关于zle reset-prompt 后 Zsh 菜单完成导致问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!