marlonrichert / zsh-autocomplete

🤖 Real-time type-ahead completion for Zsh. Asynchronous find-as-you-type autocompletion.
MIT License
5.38k stars 148 forks source link

Prompt slows down/freezes while typing #751

Open josevelaz opened 2 months ago

josevelaz commented 2 months ago

Environment

% typeset -p1 VENDOR OSTYPE ZSH_PATCHLEVEL _autocomplete__funcfiletrace

typeset VENDOR=apple
export OSTYPE=darwin23.0
typeset ZSH_PATCHLEVEL=zsh-5.9-0-g73d3173
typeset -a _autocomplete__funcfiletrace=(
  /Users/josevelazquez/marlonrichert/zsh-autocomplete/zsh-autocomplete.plugin.zsh:4
  /Users/josevelazquez/.zshrc:34
  /Users/josevelazquez/znap/functions/.znap.source:37
  /Users/josevelazquez/znap/functions/znap:27
  /Users/josevelazquez/.zshrc:15
  zsh:0
)

% git -C ~autocomplete log --oneline -n1

762afac (grafted, HEAD -> main, tag: 24.09.04, origin/main, origin/HEAD) Add note to Readme about usage of `%`

Steps to reproduce

% cd $(mktemp -d)
% git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git

Cloning into 'zsh-autocomplete'...
remote: Enumerating objects: 53, done.
remote: Counting objects: 100% (53/53), done.
remote: Compressing objects: 100% (51/51), done.
remote: Total 53 (delta 0), reused 31 (delta 0), pack-reused 0 (from 0)
Receiving objects: 100% (53/53), 1.64 MiB | 2.78 MiB/s, done.

% > .zshrc <<EOF
setopt interactivecomments transientrprompt
PS1='%# '
PS2=
RPS2='%^'
source $PWD/zsh-autocomplete/zsh-autocomplete.plugin.zsh
EOF
% env -i HOME=$PWD PATH=$PATH TERM=$TERM ${TERMINFO:+TERMINFO=$TERMINFO} zsh -d
% npm
-- Had to do ^C to kill, due to freeze
Killed by signal in _npm after 1s
Contents of ~autocomplete-log/YYYY-MM-DD.log (click to expand)
compadd:57: closing brace expected
compadd:52: parse error in command substitution
compadd:57: closing brace expected
compadd:52: parse error in command substitution
compadd:57: closing brace expected
compadd:52: parse error in command substitution
compadd:57: closing brace expected
compadd:52: parse error in command substitution
autocomplete:compadd:old:57: closing brace expected
autocomplete:compadd:old:52: parse error in command substitution
autocomplete:compadd:old:57: closing brace expected
autocomplete:compadd:old:52: parse error in command substitution
compadd:57: closing brace expected
compadd:52: parse error in command substitution
compadd:57: closing brace expected
compadd:52: parse error in command substitution
compadd:57: closing brace expected
compadd:52: parse error in command substitution
compadd:57: closing brace expected
compadd:52: parse error in command substitution
compadd:57: closing brace expected
compadd:52: parse error in command substitution
compadd:57: closing brace expected
compadd:52: parse error in command substitution
compadd:57: closing brace expected
compadd:52: parse error in command substitution
compadd:57: closing brace expected
compadd:52: parse error in command substitution
compadd:57: closing brace expected
compadd:52: parse error in command substitution
compadd:57: closing brace expected
compadd:52: parse error in command substitution
compadd:57: closing brace expected
compadd:52: parse error in command substitution
compadd:57: closing brace expected
compadd:52: parse error in command substitution
compadd:57: closing brace expected
compadd:52: parse error in command substitution
compadd:57: closing brace expected
compadd:52: parse error in command substitution
compadd:57: closing brace expected
compadd:52: parse error in command substitution
compadd:57: closing brace expected
compadd:52: parse error in command substitution
compadd:57: closing brace expected
compadd:52: parse error in command substitution
compadd:57: closing brace expected
compadd:52: parse error in command substitution
compadd:57: closing brace expected
compadd:52: parse error in command substitution
compadd:57: closing brace expected
compadd:52: parse error in command substitution
compadd:57: closing brace expected
compadd:52: parse error in command substitution
compadd:57: closing brace expected
compadd:52: parse error in command substitution
compadd:57: closing brace expected
compadd:52: parse error in command substitution
compadd:57: closing brace expected
compadd:52: parse error in command substitution
compadd:57: closing brace expected
compadd:52: parse error in command substitution
autocomplete:compadd:old:57: closing brace expected
autocomplete:compadd:old:52: parse error in command substitution
autocomplete:compadd:old:57: closing brace expected
autocomplete:compadd:old:52: parse error in command substitution
compadd:57: closing brace expected
compadd:52: parse error in command substitution
compadd:57: closing brace expected
compadd:52: parse error in command substitution
compadd:57: closing brace expected
compadd:52: parse error in command substitution
compadd:57: closing brace expected
compadd:52: parse error in command substitution
compadd:57: closing brace expected
compadd:52: parse error in command substitution
compadd:57: closing brace expected
compadd:52: parse error in command substitution
compadd:57: closing brace expected
compadd:52: parse error in command substitution
compadd:57: closing brace expected
compadd:52: parse error in command substitution
filiptrplan commented 1 month ago

For anyone searching for a solution: https://github.com/marlonrichert/zsh-autocomplete/issues/736#issuecomment-2232428532

It seems that checking out back to that commit fixes the performance problems for me.