zsh-autocomplete
zsh-autocomplete copied to clipboard
Bug with zsh-syntax-highlighting: unhandled ZLE widget
Environment
% typeset -p1 VENDOR OSTYPE ZSH_PATCHLEVEL _autocomplete__funcfiletrace
typeset -p1 VENDOR OSTYPE ZSH_PATCHLEVEL _autocomplete__funcfiletrace typeset VENDOR=redhat typeset OSTYPE=linux-gnu typeset ZSH_PATCHLEVEL=zsh-5.8-0-g77d203f typeset -a _autocomplete__funcfiletrace=( /home/shigure/.zsh/zsh-autocomplete/zsh-autocomplete.plugin.zsh:4 .zshrc:44 zsh:1 )
% git -C ~autocomplete log --oneline -n1
d408d90 (HEAD) Remove erroneous
break
statement
This is a working commit from Mar 25th I'm using on a different system, tried latest head 1968100 and another commit b62154d but the problem persists.
- Operating system: Oracle Linux 9.3
- Terminal emulator: Windows terminal
Steps to reproduce
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
git clone https://github.com/marlonrichert/zsh-autocomplete.git ~/.zsh/zsh-autocomplete
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.zsh/zsh-syntax-highlighting
Content of my .zshrc
, just kept those 3 lines to isolate the issue while I'm testing.
# zsh plugins
source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
source ~/.zsh/zsh-autocomplete/zsh-autocomplete.plugin.zsh
source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
After source, output
zsh-syntax-highlighting: unhandled ZLE widget 'insert-unambiguous-or-complete' zsh-syntax-highlighting: (This is sometimes caused by doing
bindkey <keys> insert-unambiguous-or-complete
without creating the 'insert-unambiguous-or-complete' widget withzle -N
orzle -C
.) zsh-syntax-highlighting: unhandled ZLE widget 'menu-search' zsh-syntax-highlighting: (This is sometimes caused by doingbindkey <keys> menu-search
without creating the 'menu-search' widget withzle -N
orzle -C
.) zsh-syntax-highlighting: unhandled ZLE widget 'recent-paths' zsh-syntax-highlighting: (This is sometimes caused by doingbindkey <keys> recent-paths
without creating the 'recent-paths' widget withzle -N
orzle -C
.)
originally I thought it's syntax highlighting but checking with
echo $widgets[insert-unambiguous-or-complete]
echo $widgets[recent-paths]
echo $widgets[menu-search]
I got those output
completion:complete-word:.autocomplete__complete-word__completion-widget user:.autocomplete:async:toggle-context completion:menu-select:.autocomplete__complete-word__completion-widget
If I remove auto-complete then everything works fine.
Contents of ~autocomplete-log/YYYY-MM-DD.log
(click to expand)
Same issue here. Also thought it was syntax-highlighting as that's the error output, but went through my list of plugins turning them off one by one and it stopped when autocomplete was turned off but syntax-highlighting was still on.
zsh-syntax-highlighting: unhandled ZLE widget 'menu-search'
zsh-syntax-highlighting: unhandled ZLE widget 'insert-unambiguous-or-complete'
zsh-syntax-highlighting: unhandled ZLE widget 'recent-paths'
# ------------ log
_complete:6: command not found: _autocomplete__recent_paths
_complete:7: command not found: _autocomplete__ancestor_dirs
autocomplete:_main_complete:new:post:3: command not found: _autocomplete__unambiguous
autocomplete:_main_complete:new:post:3: command not found: _autocomplete__unambiguous
If you dont like popup them, you can commit 3 line, The world is quiet now.
# zsh-autocomplete/Functions/Init/.autocomplete__key-bindings
#line 49-50:
#"$backtab" insert-unambiguous-or-complete
#'^X/' recent-paths
#line 57:
#${0}:bind menu-search history-incremental-search-forward '^S' '?'
I'm having the same issue.
I've narrowed it down to commit 545051e44407ac42215495d283c37cea9f8be362.
Before this commit, the functions rebind()
and bound()
were being called for 'menu-search', etc., and the call to bound()
would return false preventing the bindkey
command in rebind()
from executing.
After this commit, the bindkey
command is executed for all the bindings without any check. For some reason this then causes zsh-syntax-highlighting to complain about these bindings.
same issue here
For folks encountering this error who don't care about using an old-ish version of this repo, follow these steps as a quick hack to get things working. These steps assume you've already followed the installation instructions from the README.md
in this repo.
-
Delete your current copy of zsh-autocomplete:
rm ~/.config/zsh/zsh-autocomplete
-
Re-clone this repo, but this time with all the history intact:
git clone https://github.com/marlonrichert/zsh-autocomplete ~/.config/zsh/zsh-autocomplete
-
Move into that new directory and checkout to commit 8f54aabb5eee3a317ef6ea9c94d4714ae669329e, the commit just before the offending commit found by @moutazhaq:
cd ~/.config/zsh/zsh-autocomplete git checkout 8f54aabb5eee3a317ef6ea9c94d4714ae669329e
-
Reload your shell. You shouldn't see any errors anymore.
Again, by following these steps, you'll miss out on updates to this repo since April 2024.