Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug with zsh-syntax-highlighting: unhandled ZLE widget #711

Open
ForsakenRei opened this issue Apr 4, 2024 · 3 comments
Open

Bug with zsh-syntax-highlighting: unhandled ZLE widget #711

ForsakenRei opened this issue Apr 4, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@ForsakenRei
Copy link

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 with zle -N or zle -C.)
zsh-syntax-highlighting: unhandled ZLE widget 'menu-search'
zsh-syntax-highlighting: (This is sometimes caused by doing bindkey <keys> menu-search without creating the 'menu-search' widget with zle -N or zle -C.)
zsh-syntax-highlighting: unhandled ZLE widget 'recent-paths'
zsh-syntax-highlighting: (This is sometimes caused by doing bindkey <keys> recent-paths without creating the 'recent-paths' widget with zle -N or zle -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)

@ForsakenRei ForsakenRei added the bug Something isn't working label Apr 4, 2024
@Nathanjp91
Copy link

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.

@Angluca
Copy link

Angluca commented Apr 9, 2024

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' '?'

@moutazhaq
Copy link

I'm having the same issue.

I've narrowed it down to commit 545051e.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants