0.2.5 make zsh-navigation-tools unusable / non-exit-able #116
I'm seeing a similar thing when using fzf.
Can be re-produced with the following .
source $HOME/.zsh/plugins/autosuggestions/zsh-autosuggestions.zsh
fzf-history-widget() {
LBUFFER=$(fc -l 1 | fzf +s --tac -n2..,.. | sed "s/ *[0-9*]* *//")
zle redisplay
}
zle -N fzf-history-widget
bindkey -e '^r' fzf-history-widget@ronjouch do you see this issue if you comment out the references to zle redisplay? It seems to prevent this for me, however the redisplay is most certainly needed. I guess something in autosuggestions may have changed how this is handled.
I will try to step through the commits in more detail when I have some time.
Edit: I can confirm this is introduced with 5e419da
@george-b yeah, v0.2.5 is this single commit :)
Regarding your request for info, I'm a zsh user but my knowledge of programming zsh is very, very limited and I have no idea what you're talking about. Can you precise what you mean by "comment out the references to zle redisplay"? I have no such thing in my zshrc.
Regarding your request for info, I'm a zsh user but my knowledge of programming zsh is very, very limited and I have no idea what you're talking about. Can you precise what you mean by "comment out the references to zle redisplay"? I have no such thing in my zshrc.
Within zsh-navigation-tools there will be invocations of zle redisplay, e.g.
You can comment these out by prefixing them with a #. These are of course needed, in my case without the redisplay output is displayed before my prompt. However with the redisplay I am simply dropped back into fzf in my case since updating to v0.2.5 of autosuggestions.
I'm sure @ericfreese has far better knowledge of zsh widget than I, hopefully this cause of this is straight forward if you find the same behavior as I do.
So what 0.2.5 did is bind ALL widgets not found in the CLEAR, ACCEPT, or PARTIAL_ACCEPT lists to the _zsh_autosuggest_modify function: 5e419da#diff-2a58eb2e47d1b3ee3c072d264886fc66R52
Before 0.2.5, the redisplay widget was not bound, but now it is. I believe this is the same issue as described here, and I believe the correct fix is for zsh-navigation-tools to use zle .redisplay or zle .redisplay -w.
However, it's not really feasible to expect all of these other plugins to fix how they're calling zle, so I'll try to spend some time today looking into how we can handle those cases in this codebase.
I believe the correct fix is for zsh-navigation-tools to use zle .redisplay or zle .redisplay -w.
Thanks! I can confirm this works for me. If you don't mind me asking what does the . prefix do? I've had a skim through zshzle man page but am still left wondering.
No probem, glad it helps.
From http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Zle-Widgets:
Each built-in widget has two names: its normal canonical name, and the same name preceded by a ‘.’. The ‘.’ name is special: it can’t be rebound to a different widget. This makes the widget available even when its usual name has been redefined.
Ok, I've just pushed v0.2.6, which I believe will fix these issues by no longer referring to the $WIDGET variable. Please give that a shot.
Ok, I've just pushed v0.2.6, which I believe will fix these issues by no longer referring to the $WIDGET variable. Please give that a shot.
It does fix this issue however it has broken tab completion. Let me know if you want me to create a new issue for this.
$ cd _main_complete:199: command not found: expand-or-complete
_main_complete:199: command not found: modify
_main_complete:199: command not found: expand-or-complete
_main_complete:199: command not found: modify
(May be related to #115 , appeared at the same time)
Minimal
.zshrc:Scenario:
Expected: first entry is sent to current line
Actual: nothing happens: screen flickers and zsh-navigation-tools become impossible to exit (Ctrl+C, Ctrl+D don't help)