No such widget `autosuggest-orig-history-substring-search-up' #103
Have you read this note in the readme about history-substring-search?
Yes I used the snippet present in the README and placed it after the initialization of zsh-autosuggestions.
If you need to see my configuration it is here (note that I obviously tested it uncommented).
Try setting the env variables before calling autosuggest_start:
# *** Autosuggestion
# Didn't work for the moment, have to keep on eye on it
# https://github.com/tarruda/zsh-autosuggestions/
antigen bundle tarruda/zsh-autosuggestions --branch=v0.1.x
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=10'
# Add history-substring-search-* widgets to list of widgets that clear the autosuggestion
ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(history-substring-search-up history-substring-search-down)
# Remove *-line-or-history widgets from list of widgets that clear the autosuggestion to avoid conflict with history-substring-search-* widgets
SH_AUTOSUGGEST_CLEAR_WIDGETS=("${(@)ZSH_AUTOSUGGEST_CLEAR_WIDGETS:#(up|down)-line-or-history}")
autosuggest_start
Hate to be the guy... but same here. Added the suggestion but still having the same issue.
I noticed this a few days ago on my laptop and couldn't be bothered to fix it so switched to fish for the meanwhile. Just updated this today on my desktop and am experiencing the same issue.
Here is the snippet of my .zshrc that when commented fixes the issue and disables the plugin.
source /usr/share/zsh/plugins/zsh-autosuggestions/autosuggestions.zsh
zle-line-init() {
zle autosuggest-start
}
zle -N zle-line-init
Removing the history-substring-search oh-my-zsh plugin seems to fix the issue. Maybe that is to blame?
True. However, this disables all kinds of other completion commands which are quite helpful. I think I wait until this is fixed.
@frebib Actually history-substring-search from oh-my-zsh is zsh-history-substring-search which we know to cause this issue form the start.
After trying to write a minimal configuration to reproduce this issue and don't succeed at it. I have managed to fix the issue, on my side, after reading the README.md... I only had to initialize zsh-autosuggestions after zsh-syntax-highlighting as written here.
This is still strange to me as the message error refer to zsh-history-substring-search when it come from zsh-syntax-highlighting.
Can some one confirm this is working for them?
Can confirm I observe the same behaviour. (I think you mean before not after)
This is the snippet of my config:
source /usr/share/zsh/plugins/zsh-autosuggestions/autosuggestions.zsh
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
ZSH_AUTOSUGGEST_CLEAR_WIDGETS=("${(@)ZSH_AUTOSUGGEST_CLEAR_WIDGETS:#(up|down)-line-or-history}")
ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(history-substring-search-up history-substring-search-down)
zle-line-init() {
zle autosuggest-start
}
zle -N zle-line-init
#plugins=(history-substring-search zsh-completions)
plugins=(... history-substring-search ...)
source $ZSH/oh-my-zsh.sh
It seems that the issue still occurs even with this configuration when reloading the .zshrc config into an already loaded terminal but not in a new one, likely as the plugins are already loaded and initialised.
Having the config like this is better than many error messages but it does have the bizarre side-effect of not updating highlighting as I type, but still updating with arrow keys, tab etc. I'm sure that's a different issue though
Small issue, but this line
source /usr/share/zsh/plugins/zsh-autosuggestions/autosuggestions.zsh
should now be
source /usr/share/zsh/plugins/zsh-autosuggestions/dist/autosuggestions.zsh
Also, using zle-line-init and the autosuggest-start widget is now deprecated. Just call autosuggest_start after sourcing the plugin. See the readme for more info.
@frebib Nice to see that it's fixed. I meant to say:
Call
autosuggest_startafter sourcingzsh-syntax-highlighting.
As mentioned in README.md.
While the initial error is now resolved the plugin now crashes my terminal window as soon as I enter a "space" after any command, i.e. "ping(space)".
I'm using iTerm2 and load all plugins with the zgen framework. Here is my setup:
In a .zgen file
source ~/.zsh/zsh-autosuggestions/dist/autosuggestions.zsh
zgen load zsh-users/zsh-syntax-highlighting
In .zshrc
ZSH_AUTOSUGGEST_CLEAR_WIDGETS=("${(@)ZSH_AUTOSUGGEST_CLEAR_WIDGETS:#(up|down)-line-or-history}")
ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(history-substring-search-up history-substring-search-down)
autosuggest_start
Your plugin is loaded from the repro and is on the v0.1.0 branch.
When I use
zsh-history-substring-searchwith the v0.1.x branch and try to browse the history on a empty input I getNo such widget 'autosuggest-orig-history-substring-search-up'and can't go through the history. However it work as expected if the input as at least 1 character.My setup is made of:
zsh5.0.8,termite10,antigen,oh-my-zsh.