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

zsh-autocomplete prevents zoxide's popup from exiting #739

Open
artuross opened this issue Jul 10, 2024 · 2 comments
Open

zsh-autocomplete prevents zoxide's popup from exiting #739

artuross opened this issue Jul 10, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@artuross
Copy link

Description

I use zinit for loading plugins and zoxide as a cd replacement. When I type z dir <tab>, zoxide shows a popup to select directory. However, if I decide to cancel (either with ESC or ctrl + c), the popup reopens with "0n" typed to search. This happens consistently 3 times, after which canceling works as expected. The same issue occurs on each new zoxide invocation.

Please check this screencast with zsh-autocomplete:

asciicast

And without, for comparison:

asciicast

The only difference between these two in environment is line 24 in .zshrc (loading of zsh-autocomplete).

Environment

% typeset -p1 VENDOR OSTYPE ZSH_PATCHLEVEL _autocomplete__funcfiletrace
typeset VENDOR=apple
typeset OSTYPE=darwin23.0
typeset ZSH_PATCHLEVEL=zsh-5.9-0-g73d3173
typeset -a _autocomplete__funcfiletrace=(
  /Users/artur/.local/share/zinit/plugins/marlonrichert---zsh-autocomplete/zsh-autocomplete.plugin.zsh:4
  /opt/homebrew/opt/zinit/zinit.zsh:1833
  /opt/homebrew/opt/zinit/zinit.zsh:1700
  /opt/homebrew/opt/zinit/zinit.zsh:1338
  /opt/homebrew/opt/zinit/zinit.zsh:2831
  /Users/artur/.zshrc:24
  zsh:0
)

% git -C ~autocomplete log --oneline -n1
cfc3fd9 (HEAD -> main, origin/main, origin/HEAD) Fix grammar mistakes in Readme
  • Operating system: macOS 14.3 (23D5051b)
  • Terminal emulator: kitty 0.35.2

Steps to reproduce

This is my .zshrc. I've verified that commenting out loading zsh-autocomplete and restarting terminal would fix the issue. Everything (zoxide, zinit, zsh-autocomplete) is on latest version.

# ##################################################
# zinit setup
# ##################################################
if [[ ! -f "/opt/homebrew/opt/zinit/zinit.zsh" ]]; then
    echo 'zinit not installed.'
    echo 'Check https://github.com/zdharma-continuum/zinit#automatic'
    return
fi

source "/opt/homebrew/opt/zinit/zinit.zsh"
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit

# ##################################################
# plugins
# ##################################################
zinit ice lucid wait'0'

zinit light atuinsh/atuin
zinit light marlonrichert/zsh-autocomplete
zinit light zsh-users/zsh-completions
zinit light zsh-users/zsh-syntax-highlighting
zinit snippet OMZP::dotenv

autoload -Uz compinit && compinit
zmodload -i zsh/complist
rm -f ~/.zcompdump; compinit
autoload -U +X compinit && compinit
autoload -U +X bashcompinit && bashcompinit

# ##################################################
# nice tools
# ##################################################
eval "$(zoxide init zsh)"
eval "$(starship init zsh)"
@artuross artuross added the bug Something isn't working label Jul 10, 2024
@jake-klingler
Copy link

I've noticed the exact same behavior, and tracked it down to zsh-autocomplete. Commenting out zsh-autocomplete makes this issue go away. When this happens, it also leaves a zombie zsh process running with 100% cpu usage in the background.

@Meegooo
Copy link

Meegooo commented Oct 29, 2024

When this happens, it also leaves a zombie zsh process running with 100% cpu usage in the background.

I found that doing removing completions for zoxide via compdef -d z stops zombie zsh process from spawning. This obviously breaks the interactive menu, but since I don't use it, it works for me.

This implies that zombie process seems to spawn because of a compatibility issue between zoxide's compdef and zsh-autocomplete. I think a better workaround would be to stop zsh-autocomplete from doing its suggestions when command starts with z<space>, but I haven't found a way to do so.

PS. For me the popups worked as expected, it's only the zombie process that was the problem. Plugins were loaded in following order zsh-autocomplete, fzf, zoxide. But the zombie process made it impossible to use.

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

3 participants