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 plugin quite slow to initiate #763

Open
ImNotaGit opened this issue Nov 5, 2024 · 3 comments
Open

zsh-autocomplete plugin quite slow to initiate #763

ImNotaGit opened this issue Nov 5, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@ImNotaGit
Copy link

ImNotaGit commented Nov 5, 2024

This might not be a real bug, and I'm not sure if this is normal, but for me sourcing the zsh-autocomplete plugin is quite slow -- I use oh-my-zsh to manage plugins, if I disable zsh-autocomplete, then starting zsh takes ~ 1 second, but if I enable zsh-autocomplete, it takes an additional 4-5 seconds. Given that in my workflow I normally use tmux as a terminal multiplexer and opens multiple windows/panes, the delay of ~5 seconds each time I open a new window becomes quite obtrusive... Any idea of troubleshoot/speed up the startup is much appreciated!

Environment

% typeset -p1 VENDOR OSTYPE ZSH_PATCHLEVEL _autocomplete__funcfiletrace
typeset VENDOR=pc
typeset OSTYPE=linux-gnu
typeset ZSH_PATCHLEVEL=zsh-5.9-0-g73d3173
typeset -a _autocomplete__funcfiletrace=(
  /home/user/.oh-my-zsh/custom/plugins/zsh-autocomplete/zsh-autocomplete.plugin.zsh:4
  /home/user/.oh-my-zsh/oh-my-zsh.sh:175
  /home/user/.oh-my-zsh/oh-my-zsh.sh:204
  /home/user/.zshrc:64
  zsh:0
)
% git -C ~autocomplete log --oneline -n1
762afac (HEAD -> main, tag: 24.09.04, origin/main, origin/HEAD) Add note to Readme about usage of `%`
  • Operating system: CentOS
  • Terminal emulator: PuTTY (ssh)

Steps to reproduce

# install oh-my-zsh if needed following official instruction
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# clone zsh-autocomplete
mkdir -p ~/.oh-my-zsh/custom/plugins
cd ~/.oh-my-zsh/custom/plugins
git clone https://github.com/marlonrichert/zsh-autocomplete.git
# minimal .zshrc
.zshrc <<EOF
export ZSH=$HOME/.oh-my-zsh
ENABLE_CORRECTION="true"
export TERM=xterm-256color
plugins=(zsh-autocomplete)
source $ZSH/oh-my-zsh.sh
# or alternatively, instead of via oh-my-zsh and `plugins`, manually source:
source ~/.oh-my-zsh/custom/plugins/zsh-autocomplete/zsh-autocomplete.plugin.zsh
EOF
zsh
Contents of ~autocomplete-log/YYYY-MM-DD.log (click to expand)
zshexit: write error: Input/output error
zshexit: write error: Input/output error
zshexit: write error: Input/output error
zshexit: write error: Input/output error
zshexit: write error: Input/output error
zshexit: write error: Input/output error
zshexit: write error: Input/output error
zshexit: write error: Input/output error
.autocomplete:async:pty:zle-widget:15: completion cannot be used recursively (yet)
.autocomplete:async:complete:fd-widget:31: completion cannot be used recursively (yet)
.autocomplete:async:pty:zle-widget:15: completion cannot be used recursively (yet)
.autocomplete:async:pty:zle-widget:15: completion cannot be used recursively (yet)
.autocomplete:async:pty:zle-widget:15: completion cannot be used recursively (yet)
.autocomplete:async:complete:fd-widget:31: completion cannot be used recursively (yet)
.autocomplete:async:pty:zle-widget:15: completion cannot be used recursively (yet)
.autocomplete:async:complete:fd-widget:31: completion cannot be used recursively (yet)
...(more lines same as above)
@ImNotaGit ImNotaGit added the bug Something isn't working label Nov 5, 2024
@yserkann
Copy link

yserkann commented Nov 5, 2024

I have the same issue. In my situation, I only have problem if I mount e.g. OneDrive or remote file server.

@runofthemill
Copy link

@ImNotaGit not sure this is the cause, but from the minimal .zshrc above it looks like you're loading zsh-autocomplete twice; once via OMZ (plugins=(zsh-autocomplete)) and once manually (source ~/.oh-my-zsh/custom/plugins/zsh-autocomplete/zsh-autocomplete.plugin.zsh) - I wonder if that's contributing to the slowdown and "completion cannot be used recursively" logs?

@ImNotaGit
Copy link
Author

@runofthemill Thanks for the comment. Actually, I was not loading zsh-autocomplete twice in my actual .zshrc. In my example set-up above I simply intended to suggest that the issues occurs independent from how I load the plugin -- either via oh-my-zsh or manually.

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