Zsh-autocomplete: Hanging terminal while using argument autocompelete

Created on 15 Nov 2020  Â·  3Comments  Â·  Source: marlonrichert/zsh-autocomplete

Environment

  • zsh-autocomplete version: 2ed55ecf0c927479e4023395a763da01b13f94ab
  • Zsh version: 5.8
  • Framework: oh-my-zsh through antigen package manager
  • ~/.zshrc file: managed by ansible + antigen with plugins
            - name: git
            - name: command-not-found
            - name: fzf
            - name: git-extra-commands
              url: unixorn/git-extra-commands
            - name: cd-gitroot
              url: mollifier/cd-gitroot
            - name: zsh-autocomplete-full
              url: marlonrichert/zsh-autocomplete
            - name: zsh-syntax-highlighting
              url: zsh-users/zsh-syntax-highlighting
            - name: tmux-vim-integration.plugin.zsh
              url: jsahlen/tmux-vim-integration.plugin.zsh
            - name: docker
            - name: docker-compose
            - name: yarn-autocompelete
              url: g-plane/zsh-yarn-autocompletions

zsh-autocomplete

zstyle ':autocomplete:tab:*' widget-style menu-select
zstyle ':autocomplete:*' max-lines 10
zstyle ':autocomplete:*' min-input 3
zstyle ':autocomplete:tab:*' fzf-completion yes

Please test if the bug occurs without config files:

$ cd $(mktemp -d)  # Create a temp dir and enter it.
$ ZDOTDIR=$PWD HOME=$PWD zsh -f  # Start a subshell in it without config files.
% source path/to/zsh-autocomplete.plugin.zsh  # Source the plugin.
% # Try to reproduce your bug...

Does the bug occur without config files?

  • yes

If not, gradually add lines from your config file to the subshell until the bug appears.

Which combination of config causes the bug to appear?

  • ???

Steps to reproduce

  1. provide a cli with autocompletion features of zsh like git or docker-compose, hangs up on getting the arguments

Expected behavior

it to not hang while trying to get auto-completion features and do that asynchronously related to the command

Actual behavior

ezgif-2-02549f4cfce8

Hello Marlon,

Again thanks for your amazing work on this plugin. Interestingly I have yet to encounter a little problem after the last updates. I am not a hundred percent sure about this being related to the plugin or my environment but the issue is when it is trying to autocomplete zsh autocompelete-able arguments like git or docker-compose it hangs for a couple of seconds and masks the input trying to fetch the arguments. It is a natural thing to these argument fetchs take time but the issue is it renders the terminal unusable even though it gets the keystrokes in the background. So if I go git add . + enter in a fast manner it will hang in git a part wait for a couple of seconds or just timeout.

The interesting part is:

  • I have the same setup deployed via ansible to multiple environments and servers, where some of them show this behavior while some of them do not.
  • Directory autocomplete also shows the same behavior while using the full config but works fine in the clean config even though the behavior with the arguments are same.

What I have tried:

  • So I thought that long .zsh_history may be causing the issue and left only the last 5000 lines in it. But it failed to solve the issue.
  • Go back to older commits or last known working commit, with again no success. So this might be caused because of zsh or oh-my-zsh updates that is pushed by me through ansible.

I guess the latest commit you made is somehow related to this with sha 2ed55ecf0c927479e4023395a763da01b13f94ab but the problem still persists for me.

Bug report

All 3 comments

---On further notice, I have realized that this can be correlated to recent-directories recent-files because when I disable them it works a breeze.--- _TURNS OUT NOT TRUE, EDITED_

In one of the latest patches, I have realized that it is now resolving absolute paths of symlink I wonder is the cause of this problem, because before that it was not caring whether the directory is symlink or not.

EDIT:
Okay sorry for this, there might be no correlation in this.
The problem now I am having is an interesting one:

  • Delete antigen folders for a clean install
  • Install everything with scratch via ansible
    -> Everything works perfectly.
  • Logout of ssh, login / or restart ZSH
    -> The problem persists, everything responding very slowly.

So it is an interesting one. I am stomped on how to even recreate this one, or even this being related to the plugin itself.

ezgif com-gif-maker (1)

Okay with the light of this being not reproducible after antigen reinstall.

I have realized that antigen reset to clear the cache for every new terminal solves this problem and it is irrelevant to this plugin. It just brokes its behavior. Will open the issue on the antigen itself.

Again thank you again for this amazing plugin.

If you’re interesting in switching to a plugin manager that behaves more transparently than Antigen, I can highly recommend Znap. 🙂

Was this page helpful?
0 / 5 - 0 ratings