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

Autosuggestion stops functioning with zsh 5.9 after a few directory changes #441

Closed rayjanoka closed 2 years ago

rayjanoka commented 2 years ago

doesn't seem to happen with zsh 5.8

Environment

apple darwin21.3.0 /bin/zsh /opt/local/bin/zsh zsh-5.9-0-g73d3173

/Users/ray.janoka/.zsh-snap/functions/.znap.source:26
/Users/ray.janoka/.zsh-snap/functions/znap:42
.zsh.d/zsnap.zsh:2
/Users/ray.janoka/.zshrc:134

5b0073d (grafted, HEAD -> main, origin/main, origin/HEAD) Check that `$ZSH_COMPDUMP` file can be read

Steps to reproduce

cd $(mktemp -d)
git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git
> .zshrc <<EOF
PS1='%# ' PS2= RPS2='%^'; setopt transientrprompt interactivecomments
source ~/zsh-autocomplete/zsh-autocomplete.plugin.zsh
EOF
env -i HOME=$PWD PATH=$PATH TERM=$TERM ${TERMINFO:+TERMINFO=$TERMINFO} /opt/local/bin/zsh -d
Cloning into 'zsh-autocomplete'...
remote: Enumerating objects: 59, done.
remote: Counting objects: 100% (59/59), done.
remote: Compressing objects: 100% (55/55), done.
remote: Total 59 (delta 0), reused 27 (delta 0), pack-reused 0
Receiving objects: 100% (59/59), 1.64 MiB | 5.47 MiB/s, done.
% cd zsh-autocomplete
% cd ..
% cd zsh-autocomplete
% cd ..
% cd zsh-autocomplete
% cd ..
% cd zsh-autocomplete
% cd ..
% cd zsh-autocomplete
% cd ..
% cd zsh-autocomplete
% cd ..
% cd zsh-autocomplete
% cd ..
% cd zsh-autocomplete
% cd ..
% cd zsh-autocomplete
% cd 

there will be no suggestion for the final cd

JustSimplyKyle commented 2 years ago
cd $(mktemp -d)
git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git
> .zshrc <<EOF
PS1='%# ' PS2= RPS2='%^'; setopt transientrprompt interactivecomments
source ~/zsh-autocomplete/zsh-autocomplete.plugin.zsh
EOF
env -i HOME=$PWD PATH=$PATH TERM=$TERM ${TERMINFO:+TERMINFO=$TERMINFO} /bin/zsh-5.9 -d
% ferium modpack add 

> identifier -- The identifier of the modpack/project
> The Modrinth project ID is specified at the bottom of the left sidebar under 'Technical information'. You can also use the > > project slug for this
> The CurseForge mod ID is specified at the top of the right sidebar under 'About Project'

% ferium modpack

There will be no suggestions for the last command(> is for its suggestions)

pc linux-gnu /bin/zsh /bin/zsh zsh-5.9-0-g73d3173
/home/kyle/.local/share/zinit/zinit.git/zinit.zsh:1633
/home/kyle/.local/share/zinit/zinit.git/zinit.zsh:1271
/home/kyle/.local/share/zinit/zinit.git/zinit.zsh:2688
/home/kyle/.zshrc:51
5b0073d (HEAD -> main, origin/main, origin/HEAD) Check that `$ZSH_COMPDUMP` file can be read
JustSimplyKyle commented 2 years ago

But after downgrading to zsh 5.8.1 everything went back to normal

marlonrichert commented 2 years ago

I'm unable to reproduce this:

% cd $(mktemp -d)
% git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git
Cloning into 'zsh-autocomplete'...
remote: Enumerating objects: 59, done.
remote: Counting objects: 100% (59/59), done.
remote: Compressing objects: 100% (55/55), done.
remote: Total 59 (delta 0), reused 27 (delta 0), pack-reused 0
Receiving objects: 100% (59/59), 1.64 MiB | 1.21 MiB/s, done.
% > .zshrc <<EOF
PS1='%# ' PS2= RPS2='%^'; setopt transientrprompt interactivecomments
source ~/zsh-autocomplete/zsh-autocomplete.plugin.zsh
EOF
% env -i HOME=$PWD PATH=$PATH TERM=$TERM ${TERMINFO:+TERMINFO=$TERMINFO} /usr/local/opt/zsh/bin/zsh -d
% print $ZSH_VERSION
5.9
% cd zsh-autocomplete 
% cd ..
% cd zsh-autocomplete 
% cd .. 
% cd zsh-autocomplete 
% cd .. 
% cd zsh-autocomplete 
% cd .. 
% cd zsh-autocomplete 
% cd .. 
% cd zsh-autocomplete 
% cd .. 
% cd zsh-autocomplete 
% cd .. 
% cd zsh-autocomplete 
% cd .. 
% cd zsh-autocomplete 
% cd .. 
% cd zsh-autocomplete 
% cd .. 
% cd zsh-autocomplete 
% cd
directory
functions/  scripts/  
JustSimplyKyle commented 2 years ago

But I can! The number of cd steps when this problem occurs is not a static value Ex. image I did it in 3 steps, but other times, I did it in 15 steps instead. I think the way to consistant produce it is to actually type out every letter instead of doing up and selecting it.

rayjanoka commented 2 years ago

yes not exactly static, go slowly, using the up arrow doesn't work. I'm on an M1 cpu.

cd z\\ cd ..\ repeat

ozwaldorf commented 2 years ago

Can verify this breaks the completions for me as well. manjaro + zsh 5.9

iroedius commented 2 years ago

Same here. After pressing the Enter key exactly 27 times, every time, the completions disappear. The problem occurs only on zsh 5.9, downgrading to 5.8.1 fixes it.

CaptainJack42 commented 2 years ago

Same here (manjaro + Konsole + zsh 5.9)

It also seems to break for me as soon as i tab out of my Terminal and tab back in.

marlonrichert commented 2 years ago

@ozwaldorf @iroedius @rayjanoka @CaptainJack42

Can you please do the following?

  1. Run
    rm -rf $_autocomplete__log $_autocomplete__log_async $_autocomplete__log_pty
    functions -t $_autocomplete__log_functions[@]
  2. Reproduce the problem.
  3. Note the exact time on which the problem was reproduced and share it here.
  4. Kill the shell.
  5. Attach to your comment the files referenced by $_autocomplete__log, $_autocomplete__log_async and $_autocomplete__log_pty
CaptainJack42 commented 2 years ago

2022-06-20..tar.gz

@marlonrichert Here are the log files. It took a pretty long time to reproduce this time, however i now found a method to reproduce it relatively consistent:

  1. Type/Autocomplete a relatively long command/path (e.g cd /path/to/some/folder/foo/bar/) and don't press enter.
  2. Delete the command by holding backspace.
  3. At some point during the deletion process the plugin will break (i am able to notice the point since at the same point zsh-syntax-highlighting will also break, however only for this specific line and when typing something new syntax highlighting will work again).

Hope i can help with this.

marlonrichert commented 2 years ago

@CaptainJack42 Thanks! This is the offending line:

.autocomplete.recent_paths.add:shift:16: shift count must be <= $#

https://github.com/marlonrichert/zsh-autocomplete/blob/5b0073d8ffde20498c820f94ddc62b7f3f54cfc7/functions/completion/_autocomplete.recent_paths#L41

So, judging from the surrounding code, it appears that $displ[@] has fewer elements than $matches[@].

marlonrichert commented 2 years ago

However, I'm still unable to reproduce any of this. 🙁

ttytm commented 2 years ago

Good to see an issue open on this. I thought I'm a lonely poor mofo who unknowingly broke his system and now can't find a solution. Basically just a little bump to this issue, that it also can be verified on the machine I'm using.

marlonrichert commented 2 years ago

@tobealive Can you try to put together a test case that I can use to reproduce the problem? So far, I have not been able to.

ttytm commented 2 years ago

Hi @marlonrichert, when I have some minutes I could try to provide a scenario using a VM with a liveboot or clean install. To be sure it is something reproducible.

Would that be something of use to you or too much of a hassle to find a solution?

marlonrichert commented 2 years ago

@tobealive I don’t have anything set up to run VMs, but if you can provide clear instructions on how to run it, then yes, that would be useful.

JustSimplyKyle commented 2 years ago

Not a VM but, a docker file Create a file called Dockerfile in a empty directory.

FROM archlinux:base-devel

RUN pacman --needed --noconfirm -Syu pacman-contrib git zsh

# Add non-root user
RUN useradd -m builder && \
  echo 'builder ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
# Switch user and cwd
USER builder
WORKDIR /home/builder

And then in the same folder run sudo docker build -t nodebb . sudo docker run -it --entrypoint /bin/zsh nodebb And then zsh comfiguration screen will pop up, complete it. Next do:

cd $(mktemp -d)
git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git
> .zshrc <<EOF
PS1='%# ' PS2= RPS2='%^'; setopt transientrprompt interactivecomments
source ~/zsh-autocomplete/zsh-autocomplete.plugin.zsh
EOF
env -i HOME=$PWD PATH=$PATH TERM=$TERM ${TERMINFO:+TERMINFO=$TERMINFO} zsh -d

And do what https://github.com/marlonrichert/zsh-autocomplete/issues/441#issuecomment-1160331716 says to reproduce the scenario. I personally can reproduce it just by typing cd zsh-autocomlete individually, and delete the command by holding backspace.

marlonrichert commented 2 years ago

@KyleUltimate Thanks! I'm able to reproduce it with this. 🥳

marlonrichert commented 2 years ago

...but now I'm again unable to reproduce it. I managed to reproduce it only once and completely by accident. Not sure what steps I did that caused it. 😕

JustSimplyKyle commented 2 years ago

Even after reentering the docker? (exit and do the docker run again)

marlonrichert commented 2 years ago

Nope. Can you give me a path in the Docker environment with which you are able to reproduce the problem?

JustSimplyKyle commented 2 years ago

File... path? I don't quite understand what you mean. If you mean where zsh-complete is, it's just in the image

marlonrichert commented 2 years ago

@KyleUltimate These are the steps to reproduce in the comment you linked to:

  1. Type/Autocomplete a relatively long command/path (e.g cd /path/to/some/folder/foo/bar/) and don't press enter.
  2. Delete the command by holding backspace.
  3. At some point during the deletion process the plugin will break (i am able to notice the point since at the same point zsh-syntax-highlighting will also break, however only for this specific line and when typing something new syntax highlighting will work again).

So, I need a sufficiently long directory path to reproduce to reproduce it. So far, I have not been able to find one.

JustSimplyKyle commented 2 years ago

/usr/share/gdb/auto-load/usr/lib/libglib-2.0.so.0.7200.2-gdb.py (for me, 99% of the time the completion disappear midway typing through libglib...)

CaptainJack42 commented 2 years ago

@marlonrichert

So, I need a sufficiently long directory path to reproduce to reproduce it. So far, I have not been able to find one.

I also can't reproduce it with the existing directories in the docker container, but just creating a very long path inside the docker container (e.g. mkdir -p sth-long/very-long-directory-name/tmp/foo/bar/very-nice-name/extremely-long-path/user/projects/foo/bar/dir/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z) and than trying to autocomplete cd into this directory will either break the plugin while repeatedly pressing tab or when deleting the whole thing again by holding backspace.

However it is significantly harder to break the plugin in the docker container than on my system.

One very uneducated guess to why this is happening is that at a certain point is that the autocompletions change to quickly and the system can't keep up with it anymore and the plugin breaks.

Edit: Also resourcing the .zshrc (or just the zsh-autocomplete.plugin.zsh) will fix the issue.

CaptainJack42 commented 2 years ago

Update: My very uneducated guess was wrong. I tried to reproduce it on my convertible Laptop (running Linux Mint with Kernel v5.4, i3-6100U CPU and 4GB of RAM) and was unable to reproduce it with and without (which isn't really surprising since it's running zsh v5.8) the docker file.

So it seems to only be an issue with newer Kernels or arch-based Kernels (and macOS from what other commenters said), so far i've only noticed the issue on anything arch-based (tried it on Manjaro, Arch and Arcolinux so far). It's also independent from the Terminal Emulator (same issue with Konsole, xfce4-terminal and Terminator).

I can try and provide a setup for a VM to reproduce the issue in a bit.

marlonrichert commented 2 years ago

Edit: Also resourcing the .zshrc (or just the zsh-autocomplete.plugin.zsh) will fix the issue.

Thanks, that gives a good clue. Based on that, my guess is that the internal state of Zsh Autocomplete gets messed up somewhere because of concurrent modification.

Zsh does not have a native way of ensuring thread safety. In fact, it does not have threads at all: For example, if a Trap occurs during an asynchronous callback, the operations from both codes will run interleaved inside your shell session and can access (and thus overwrite) each other's variables. 😱

I'll have to see if I can implement some kind of locking mechanism. Patches welcome, of course. 🙂

marlonrichert commented 2 years ago

@ozwaldorf @iroedius @rayjanoka @CaptainJack42 @tobealive @KyleUltimate

Can you try the following?

  1. Reproduce the bug in your test environment.
  2. Run functions -T .autocomplete.async.complete .autocomplete.zle-flags.
  3. Try to activate autocompletion once.
  4. Paste the debug output here.
CaptainJack42 commented 2 years ago

@marlonrichert

Hoping this helps (didn't really know what you menat with activate autocompletion once, but i just typed cd once after running functions -T ...)

Click to expand ``` +.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 && -n zle-line-init ]] +.autocomplete.zle-flags:6> typeset -gH _autocomplete__last_widget=zle-line-init +.autocomplete.zle-flags:9> case zle-line-init (*kill-*~vi-*) +.autocomplete.zle-flags:9> case zle-line-init (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case zle-line-init (vi-*put-*before) +.autocomplete.zle-flags:9> case zle-line-init (*) +.autocomplete.zle-flags:23> return 0 +.autocomplete.async.complete:1> .autocomplete.zle-flags zle-line-finish +.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 && -n zle-line-finish ]] +.autocomplete.zle-flags:6> typeset -gH _autocomplete__last_widget=zle-line-finish +.autocomplete.zle-flags:9> case zle-line-finish (*kill-*~vi-*) +.autocomplete.zle-flags:9> case zle-line-finish (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case zle-line-finish (vi-*put-*before) +.autocomplete.zle-flags:9> case zle-line-finish (*) +.autocomplete.zle-flags:23> return 0 +.autocomplete.async.complete:3> (( KEYS_QUEUED_COUNT || PENDING )) +.autocomplete.async.complete:6> region_highlight=( ) +.autocomplete.async.complete:7> [[ -v 'functions[_zsh_highlight]' ]] +.autocomplete.async.complete:8> _zsh_highlight +.autocomplete.async.complete:9> typeset -gH _autocomplete__highlight=( '0 9 fg=green memo=zsh-syntax-highlighting' '10 12 none memo=zsh-syntax-highlighting' '13 41 none memo=zsh-syntax-highlighting' '42 65 none memo=zsh-syntax-highlighting' ) +.autocomplete.async.complete:10> [[ -v 'functions[_zsh_autosuggest_highlight_apply]' ]] +.autocomplete.async.complete:11> _zsh_autosuggest_highlight_apply +.autocomplete.async.complete:13> [[ zle-line-finish == .autocomplete.async.complete.fd-widget ]] +.autocomplete.async.complete:16> .autocomplete.async.stop +.autocomplete.async.complete:18> (( REGION_ACTIVE )) +.autocomplete.async.complete:19> [[ -v _autocomplete__isearch ]] +.autocomplete.async.complete:24> [[ zle-line-finish == (_complete_help|list-expand|(|.)(describe-key-briefly|what-cursor-position|where-is)) ]] +.autocomplete.async.complete:28> [[ '' == *unambiguous ]] +.autocomplete.async.complete:31> .autocomplete.async.start +.autocomplete.async.complete:32> return 0 +.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 && -n self-insert ]] Music/ Pictures/ Projects/ Public/ Templates/ Videos/ arco-i3/ cloud/ git/ mnt/ qemu/ thesis/ +.autocomplete.zle-flags:6> typeset -gH _autocomplete__last_widget=self-insert +.autocomplete.zle-flags:9> case self-insert (*kill-*~vi-*) +.autocomplete.zle-flags:9> case self-insert (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case self-insert (vi-*put-*before) +.autocomplete.zle-flags:9> case self-insert (*) +.autocomplete.zle-flags:23> return 0 +.autocomplete.async.complete:1> .autocomplete.zle-flags self-insert +.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 && -n self-insert ]] +.autocomplete.zle-flags:6> typeset -gH _autocomplete__last_widget=self-insert +.autocomplete.zle-flags:9> case self-insert (*kill-*~vi-*) +.autocomplete.zle-flags:9> case self-insert (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case self-insert (vi-*put-*before) +.autocomplete.zle-flags:9> case self-insert (*) +.autocomplete.zle-flags:23> return 0 +.autocomplete.async.complete:3> (( KEYS_QUEUED_COUNT || PENDING )) +.autocomplete.async.complete:6> region_highlight=( ) +.autocomplete.async.complete:7> [[ -v 'functions[_zsh_highlight]' ]] +.autocomplete.async.complete:8> _zsh_highlight +.autocomplete.async.complete:9> typeset -gH _autocomplete__highlight=( '0 1 underline memo=zsh-syntax-highlighting' ) +.autocomplete.async.complete:10> [[ -v 'functions[_zsh_autosuggest_highlight_apply]' ]] +.autocomplete.async.complete:11> _zsh_autosuggest_highlight_apply +.autocomplete.async.complete:13> [[ self-insert == .autocomplete.async.complete.fd-widget ]] +.autocomplete.async.complete:16> .autocomplete.async.stop +.autocomplete.async.complete:18> (( REGION_ACTIVE )) +.autocomplete.async.complete:19> [[ -v _autocomplete__isearch ]] +.autocomplete.async.complete:24> [[ self-insert == (_complete_help|list-expand|(|.)(describe-key-briefly|what-cursor-position|where-is)) ]] +.autocomplete.async.complete:28> [[ '' == *unambiguous ]] +.autocomplete.async.complete:31> .autocomplete.async.start +.autocomplete.async.complete:32> return 0 c+.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 ]] +.autocomplete.zle-flags:9> case self-insert (*kill-*~vi-*) +.autocomplete.zle-flags:9> case self-insert (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case self-insert (vi-*put-*before) +.autocomplete.zle-flags:9> case self-insert (*) +.autocomplete.zle-flags:23> return 0 coc+.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 && -n self-insert ]] compadd compaudit compdef compdump compgen compinit compinstall complete current_branch +.autocomplete.zle-flags:6> typeset -gH _autocomplete__last_widget=self-insert +.autocomplete.zle-flags:9> case self-insert (*kill-*~vi-*) +.autocomplete.zle-flags:9> case self-insert (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case self-insert (vi-*put-*before) +.autocomplete.zle-flags:9> case self-insert (*) +.autocomplete.zle-flags:23> return 0 +.autocomplete.async.complete:1> .autocomplete.zle-flags self-insert +.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 && -n self-insert ]] +.autocomplete.zle-flags:6> typeset -gH _autocomplete__last_widget=self-insert +.autocomplete.zle-flags:9> case self-insert (*kill-*~vi-*) +.autocomplete.zle-flags:9> case self-insert (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case self-insert (vi-*put-*before) +.autocomplete.zle-flags:9> case self-insert (*) +.autocomplete.zle-flags:23> return 0 +.autocomplete.async.complete:3> (( KEYS_QUEUED_COUNT || PENDING )) +.autocomplete.async.complete:6> region_highlight=( ) +.autocomplete.async.complete:7> [[ -v 'functions[_zsh_highlight]' ]] +.autocomplete.async.complete:8> _zsh_highlight +.autocomplete.async.complete:9> typeset -gH _autocomplete__highlight=( '0 2 fg=green memo=zsh-syntax-highlighting' ) +.autocomplete.async.complete:10> [[ -v 'functions[_zsh_autosuggest_highlight_apply]' ]] +.autocomplete.async.complete:11> _zsh_autosuggest_highlight_apply +.autocomplete.async.complete:13> [[ self-insert == .autocomplete.async.complete.fd-widget ]] +.autocomplete.async.complete:16> .autocomplete.async.stop +.autocomplete.async.complete:18> (( REGION_ACTIVE )) +.autocomplete.async.complete:19> [[ -v _autocomplete__isearch ]] +.autocomplete.async.complete:24> [[ self-insert == (_complete_help|list-expand|(|.)(describe-key-briefly|what-cursor-position|where-is)) ]] +.autocomplete.async.complete:28> [[ '' == *unambiguous ]] +.autocomplete.async.complete:31> .autocomplete.async.start +.autocomplete.async.complete:32> return 0 cd+.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 ]] +.autocomplete.zle-flags:9> case self-insert (*kill-*~vi-*) +.autocomplete.zle-flags:9> case self-insert (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case self-insert (vi-*put-*before) +.autocomplete.zle-flags:9> case self-insert (*) +.autocomplete.zle-flags:23> return 0 ```
JustSimplyKyle commented 2 years ago
Click to expand ``` % functions -T .autocomplete.async.complete .autocomplete.zle-flags % +.autocomplete.async.complete:1> .autocomplete.zle-flags zle-line-finish +.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 && -n zle-line-finish ]] +.autocomplete.zle-flags:6> typeset -gH _autocomplete__last_widget=zle-line-finish +.autocomplete.zle-flags:9> case zle-line-finish (*kill-*~vi-*) +.autocomplete.zle-flags:9> case zle-line-finish (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case zle-line-finish (vi-*put-*before) +.autocomplete.zle-flags:9> case zle-line-finish (*) +.autocomplete.zle-flags:23> return 0 +.autocomplete.async.complete:3> (( KEYS_QUEUED_COUNT || PENDING )) +.autocomplete.async.complete:6> region_highlight=( ) +.autocomplete.async.complete:7> [[ -v 'functions[_zsh_highlight]' ]] +.autocomplete.async.complete:9> typeset -gH _autocomplete__highlight=( ) +.autocomplete.async.complete:10> [[ -v 'functions[_zsh_autosuggest_highlight_apply]' ]] +.autocomplete.async.complete:13> [[ zle-line-finish == .autocomplete.async.complete.fd-widget ]] +.autocomplete.async.complete:16> .autocomplete.async.stop +.autocomplete.async.complete:18> (( REGION_ACTIVE )) +.autocomplete.async.complete:19> [[ -v _autocomplete__isearch ]] +.autocomplete.async.complete:24> [[ zle-line-finish == (_complete_help|list-expand|(|.)(describe-key-briefly|what-cursor-position|where-is)) ]] +.autocomplete.async.complete:28> [[ '' == *unambiguous ]] +.autocomplete.async.complete:31> .autocomplete.async.start +.autocomplete.async.complete:32> return 0 +.autocomplete.async.complete:1> .autocomplete.zle-flags self-insert +.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 && -n self-insert ]] +.autocomplete.zle-flags:6> typeset -gH _autocomplete__last_widget=self-insert +.autocomplete.zle-flags:9> case self-insert (*kill-*~vi-*) +.autocomplete.zle-flags:9> case self-insert (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case self-insert (vi-*put-*before) +.autocomplete.zle-flags:9> case self-insert (*) +.autocomplete.zle-flags:23> return 0 +.autocomplete.async.complete:3> (( KEYS_QUEUED_COUNT || PENDING )) +.autocomplete.async.complete:6> region_highlight=( ) +.autocomplete.async.complete:7> [[ -v 'functions[_zsh_highlight]' ]] +.autocomplete.async.complete:9> typeset -gH _autocomplete__highlight=( ) +.autocomplete.async.complete:10> [[ -v 'functions[_zsh_autosuggest_highlight_apply]' ]] +.autocomplete.async.complete:13> [[ self-insert == .autocomplete.async.complete.fd-widget ]] +.autocomplete.async.complete:16> .autocomplete.async.stop +.autocomplete.async.complete:18> (( REGION_ACTIVE )) +.autocomplete.async.complete:19> [[ -v _autocomplete__isearch ]] +.autocomplete.async.complete:24> [[ self-insert == (_complete_help|list-expand|(|.)(describe-key-briefly|what-cursor-position|where-is)) ]] +.autocomplete.async.complete:28> [[ '' == *unambiguous ]] +.autocomplete.async.complete:31> .autocomplete.async.start +.autocomplete.async.complete:32> return 0 c c+.autocomplete.async.complete:1> .autocomplete.zle-flags self-insert +.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 && -n self-insert ]] +.autocomplete.zle-flags:6> typeset -gH _autocomplete__last_widget=self-insert +.autocomplete.zle-flags:9> case self-insert (*kill-*~vi-*) +.autocomplete.zle-flags:9> case self-insert (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case self-insert (vi-*put-*before) +.autocomplete.zle-flags:9> case self-insert (*) +.autocomplete.zle-flags:23> return 0 +.autocomplete.async.complete:3> (( KEYS_QUEUED_COUNT || PENDING )) +.autocomplete.async.complete:6> region_highlight=( ) +.autocomplete.async.complete:7> [[ -v 'functions[_zsh_highlight]' ]] +.autocomplete.async.complete:9> typeset -gH _autocomplete__highlight=( ) +.autocomplete.async.complete:10> [[ -v 'functions[_zsh_autosuggest_highlight_apply]' ]] +.autocomplete.async.complete:13> [[ self-insert == .autocomplete.async.complete.fd-widget ]] +.autocomplete.async.complete:16> .autocomplete.async.stop +.autocomplete.async.complete:18> (( REGION_ACTIVE )) +.autocomplete.async.complete:19> [[ -v _autocomplete__isearch ]] +.autocomplete.async.complete:24> [[ self-insert == (_complete_help|list-expand|(|.)(describe-key-briefly|what-cursor-position|where-is)) ]] +.autocomplete.async.complete:28> [[ '' == *unambiguous ]] +.autocomplete.async.complete:31> .autocomplete.async.start +.autocomplete.async.complete:32> return 0 cdcd+.autocomplete.async.complete:1> .autocomplete.zle-flags self-insert +.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal cd-read cdda-player cddb_query cdparanoia cdrskin +.autocomplete.zle-flags:5> [[ -v 1 && -n self-insert ]] +.autocomplete.zle-flags:6> typeset -gH _autocomplete__last_widget=self-insert +.autocomplete.zle-flags:9> case self-insert (*kill-*~vi-*) +.autocomplete.zle-flags:9> case self-insert (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case self-insert (vi-*put-*before) +.autocomplete.zle-flags:9> case self-insert (*) +.autocomplete.zle-flags:23> return 0 +.autocomplete.async.complete:3> (( KEYS_QUEUED_COUNT || PENDING )) +.autocomplete.async.complete:6> region_highlight=( ) +.autocomplete.async.complete:7> [[ -v 'functions[_zsh_highlight]' ]] +.autocomplete.async.complete:9> typeset -gH _autocomplete__highlight=( ) +.autocomplete.async.complete:10> [[ -v 'functions[_zsh_autosuggest_highlight_apply]' ]] +.autocomplete.async.complete:13> [[ self-insert == .autocomplete.async.complete.fd-widget ]] +.autocomplete.async.complete:16> .autocomplete.async.stop +.autocomplete.async.complete:18> (( REGION_ACTIVE )) +.autocomplete.async.complete:19> [[ -v _autocomplete__isearch ]] +.autocomplete.async.complete:24> [[ self-insert == (_complete_help|list-expand|(|.)(describe-key-briefly|what-cursor-position|where-is)) ]] +.autocomplete.async.complete:28> [[ '' == *unambiguous ]] +.autocomplete.async.complete:31> .autocomplete.async.start +.autocomplete.async.complete:32> return 0 cd +.autocomplete.async.complete:1> .autocomplete.zle-flags .autocomplete.async.complete.fd-widget +.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 && -n .autocomplete.async.complete.fd-widget ]] +.autocomplete.zle-flags:6> typeset -gH _autocomplete__last_widget=.autocomplete.async.complete.fd-widget +.autocomplete.zle-flags:9> case .autocomplete.async.complete.fd-widget (*kill-*~vi-*) +.autocomplete.zle-flags:9> case .autocomplete.async.complete.fd-widget (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case .autocomplete.async.complete.fd-widget (vi-*put-*before) +.autocomplete.zle-flags:9> case .autocomplete.async.complete.fd-widget (*) +.autocomplete.zle-flags:23> return 0 +.autocomplete.async.complete:3> (( KEYS_QUEUED_COUNT || PENDING )) +.autocomplete.async.complete:6> region_highlight=( ) +.autocomplete.async.complete:7> [[ -v 'functions[_zsh_highlight]' ]] +.autocomplete.async.complete:9> typeset -gH _autocomplete__highlight=( ) +.autocomplete.async.complete:10> [[ -v 'functions[_zsh_autosuggest_highlight_apply]' ]] +.autocomplete.async.complete:13> [[ .autocomplete.async.complete.fd-widget == .autocomplete.async.complete.fd-widget ]] +.autocomplete.async.complete:14> return +.autocomplete.async.complete:1> .autocomplete.zle-flags complete-word +.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 && -n complete-word ]] +.autocomplete.zle-flags:6> typeset -gH _autocomplete__last_widget=complete-word +.autocomplete.zle-flags:9> case complete-word (*kill-*~vi-*) +.autocomplete.zle-flags:9> case complete-word (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case complete-word (vi-*put-*before) +.autocomplete.zle-flags:9> case complete-word (*) +.autocomplete.zle-flags:23> return 0 +.autocomplete.async.complete:3> (( KEYS_QUEUED_COUNT || PENDING )) +.autocomplete.async.complete:6> region_highlight=( ) +.autocomplete.async.complete:7> [[ -v 'functions[_zsh_highlight]' ]] +.autocomplete.async.complete:9> typeset -gH _autocomplete__highlight=( ) +.autocomplete.async.complete:10> [[ -v 'functions[_zsh_autosuggest_highlight_apply]' ]] +.autocomplete.async.complete:13> [[ complete-word == .autocomplete.async.complete.fd-widget ]] +.autocomplete.async.complete:16> .autocomplete.async.stop +.autocomplete.async.complete:18> (( REGION_ACTIVE )) +.autocomplete.async.complete:19> [[ -v _autocomplete__isearch ]] +.autocomplete.async.complete:24> [[ complete-word == (_complete_help|list-expand|(|.)(describe-key-briefly|what-cursor-position|where-is)) ]] +.autocomplete.async.complete:28> [[ 1 == *unambiguous ]] +.autocomplete.async.complete:31> .autocomplete.async.start +.autocomplete.async.complete:32> return 0 ```
ttytm commented 2 years ago

Output after plugin stopped working, running functions -T .autocomplete.async.complete .autocomplete.zle-flags and cd:

Click to expand ``` +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 && -n self-insert ]] +.autocomplete.zle-flags:6> typeset -gH _autocomplete__last_widget=self-insert +.autocomplete.zle-flags:9> case self-insert (*kill-*~vi-*) +.autocomplete.zle-flags:9> case self-insert (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case self-insert (vi-*put-*before) +.autocomplete.zle-flags:9> case self-insert (*) +.autocomplete.zle-flags:23> return 0 +.autocomplete.async.complete:1> .autocomplete.zle-flags self-insert +.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 && -n self-insert ]] +.autocomplete.zle-flags:6> typeset -gH _autocomplete__last_widget=self-insert +.autocomplete.zle-flags:9> case self-insert (*kill-*~vi-*) +.autocomplete.zle-flags:9> case self-insert (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case self-insert (vi-*put-*before) +.autocomplete.zle-flags:9> case self-insert (*) +.autocomplete.zle-flags:23> return 0 +.autocomplete.async.complete:3> (( KEYS_QUEUED_COUNT || PENDING )) +.autocomplete.async.complete:6> region_highlight=( ) +.autocomplete.async.complete:7> [[ -v 'functions[_zsh_highlight]' ]] +.autocomplete.async.complete:8> _zsh_highlight +.autocomplete.async.complete:9> typeset -gH _autocomplete__highlight=( '0 1 fg=red,bold memo=zsh-syntax-highlighting' ) +.autocomplete.async.complete:10> [[ -v 'functions[_zsh_autosuggest_highlight_apply]' ]] +.autocomplete.async.complete:11> _zsh_autosuggest_highlight_apply +.autocomplete.async.complete:13> [[ self-insert == .autocomplete.async.complete.fd-widget ]] +.autocomplete.async.complete:16> .autocomplete.async.stop +.autocomplete.async.complete:18> (( REGION_ACTIVE )) +.autocomplete.async.complete:19> [[ -v _autocomplete__isearch ]] +.autocomplete.async.complete:24> [[ self-insert == (_complete_help|list-expand|(|.)(describe-key-briefly|what-cursor-position|where-is)) ]] +.autocomplete.async.complete:28> [[ 1 == *unambiguous ]] +.autocomplete.async.complete:31> .autocomplete.async.start +.autocomplete.async.complete:32> return 0 c+.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 ]] +.autocomplete.zle-flags:9> case self-insert (*kill-*~vi-*) +.autocomplete.zle-flags:9> case self-insert (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case self-insert (vi-*put-*before) +.autocomplete.zle-flags:9> case self-insert (*) +.autocomplete.zle-flags:23> return 0 c+.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 && -n self-insert ]] +.autocomplete.zle-flags:6> typeset -gH _autocomplete__last_widget=self-insert +.autocomplete.zle-flags:9> case self-insert (*kill-*~vi-*) +.autocomplete.zle-flags:9> case self-insert (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case self-insert (vi-*put-*before) +.autocomplete.zle-flags:9> case self-insert (*) +.autocomplete.zle-flags:23> return 0 +.autocomplete.async.complete:1> .autocomplete.zle-flags self-insert +.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 && -n self-insert ]] +.autocomplete.zle-flags:6> typeset -gH _autocomplete__last_widget=self-insert +.autocomplete.zle-flags:9> case self-insert (*kill-*~vi-*) +.autocomplete.zle-flags:9> case self-insert (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case self-insert (vi-*put-*before) +.autocomplete.zle-flags:9> case self-insert (*) +.autocomplete.zle-flags:23> return 0 +.autocomplete.async.complete:3> (( KEYS_QUEUED_COUNT || PENDING )) +.autocomplete.async.complete:6> region_highlight=( ) +.autocomplete.async.complete:7> [[ -v 'functions[_zsh_highlight]' ]] +.autocomplete.async.complete:8> _zsh_highlight +.autocomplete.async.complete:9> typeset -gH _autocomplete__highlight=( '0 2 fg=green memo=zsh-syntax-highlighting' ) +.autocomplete.async.complete:10> [[ -v 'functions[_zsh_autosuggest_highlight_apply]' ]] +.autocomplete.async.complete:11> _zsh_autosuggest_highlight_apply +.autocomplete.async.complete:13> [[ self-insert == .autocomplete.async.complete.fd-widget ]] +.autocomplete.async.complete:16> .autocomplete.async.stop +.autocomplete.async.complete:18> (( REGION_ACTIVE )) +.autocomplete.async.complete:19> [[ -v _autocomplete__isearch ]] +.autocomplete.async.complete:24> [[ self-insert == (_complete_help|list-expand|(|.)(describe-key-briefly|what-cursor-position|where-is)) ]] +.autocomplete.async.complete:28> [[ 1 == *unambiguous ]] +.autocomplete.async.complete:31> .autocomplete.async.start +.autocomplete.async.complete:32> return 0 ```
marlonrichert commented 2 years ago

Thanks! I’ll have to analyze this a bit further. At least from a quick glance, it looks like in @KyleUltimate’s & @tobealive’s case, the callback function is never reached.

As a workaround, can you try increasing the value of this parameter from the default of 0.05 seconds?

https://github.com/marlonrichert/zsh-autocomplete/blob/f52f45a49d2df31e7d7aff1fb599c89b1eacbcef/.zshrc#L11

Does that help?

JustSimplyKyle commented 2 years ago

Nope, still breaks. this is what after cd zsh tab happens.(with the autocomplete zstyle in zshrc)

Click to expand ``` % functions -T .autocomplete.async.complete .autocomplete.zle-flags % +.autocomplete.async.complete:1> .autocomplete.zle-flags zle-line-finish +.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 && -n zle-line-finish ]] +.autocomplete.zle-flags:6> typeset -gH _autocomplete__last_widget=zle-line-finish +.autocomplete.zle-flags:9> case zle-line-finish (*kill-*~vi-*) +.autocomplete.zle-flags:9> case zle-line-finish (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case zle-line-finish (vi-*put-*before) +.autocomplete.zle-flags:9> case zle-line-finish (*) +.autocomplete.zle-flags:23> return 0 +.autocomplete.async.complete:3> (( KEYS_QUEUED_COUNT || PENDING )) +.autocomplete.async.complete:6> region_highlight=( ) +.autocomplete.async.complete:7> [[ -v 'functions[_zsh_highlight]' ]] +.autocomplete.async.complete:9> typeset -gH _autocomplete__highlight=( ) +.autocomplete.async.complete:10> [[ -v 'functions[_zsh_autosuggest_highlight_apply]' ]] +.autocomplete.async.complete:13> [[ zle-line-finish == .autocomplete.async.complete.fd-widget ]] +.autocomplete.async.complete:16> .autocomplete.async.stop +.autocomplete.async.complete:18> (( REGION_ACTIVE )) +.autocomplete.async.complete:19> [[ -v _autocomplete__isearch ]] +.autocomplete.async.complete:24> [[ zle-line-finish == (_complete_help|list-expand|(|.)(describe-key-briefly|what-cursor-position|where-is)) ]] +.autocomplete.async.complete:28> [[ '' == *unambiguous ]] +.autocomplete.async.complete:31> .autocomplete.async.start +.autocomplete.async.complete:32> return 0 +.autocomplete.async.complete:1> .autocomplete.zle-flags self-insert +.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 && -n self-insert ]] +.autocomplete.zle-flags:6> typeset -gH _autocomplete__last_widget=self-insert +.autocomplete.zle-flags:9> case self-insert (*kill-*~vi-*) +.autocomplete.zle-flags:9> case self-insert (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case self-insert (vi-*put-*before) +.autocomplete.zle-flags:9> case self-insert (*) +.autocomplete.zle-flags:23> return 0 +.autocomplete.async.complete:3> (( KEYS_QUEUED_COUNT || PENDING )) +.autocomplete.async.complete:6> region_highlight=( ) +.autocomplete.async.complete:7> [[ -v 'functions[_zsh_highlight]' ]] +.autocomplete.async.complete:9> typeset -gH _autocomplete__highlight=( ) +.autocomplete.async.complete:10> [[ -v 'functions[_zsh_autosuggest_highlight_apply]' ]] +.autocomplete.async.complete:13> [[ self-insert == .autocomplete.async.complete.fd-widget ]] +.autocomplete.async.complete:16> .autocomplete.async.stop +.autocomplete.async.complete:18> (( REGION_ACTIVE )) +.autocomplete.async.complete:19> [[ -v _autocomplete__isearch ]] +.autocomplete.async.complete:24> [[ self-insert == (_complete_help|list-expand|(|.)(describe-key-briefly|what-cursor-position|where-is)) ]] +.autocomplete.async.complete:28> [[ '' == *unambiguous ]] +.autocomplete.async.complete:31> .autocomplete.async.start +.autocomplete.async.complete:32> return 0 c c+.autocomplete.async.complete:1> .autocomplete.zle-flags self-insert +.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 && -n self-insert ]] +.autocomplete.zle-flags:6> typeset -gH _autocomplete__last_widget=self-insert +.autocomplete.zle-flags:9> case self-insert (*kill-*~vi-*) +.autocomplete.zle-flags:9> case self-insert (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case self-insert (vi-*put-*before) +.autocomplete.zle-flags:9> case self-insert (*) +.autocomplete.zle-flags:23> return 0 +.autocomplete.async.complete:3> (( KEYS_QUEUED_COUNT || PENDING )) +.autocomplete.async.complete:6> region_highlight=( ) +.autocomplete.async.complete:7> [[ -v 'functions[_zsh_highlight]' ]] +.autocomplete.async.complete:9> typeset -gH _autocomplete__highlight=( ) +.autocomplete.async.complete:10> [[ -v 'functions[_zsh_autosuggest_highlight_apply]' ]] +.autocomplete.async.complete:13> [[ self-insert == .autocomplete.async.complete.fd-widget ]] +.autocomplete.async.complete:16> .autocomplete.async.stop +.autocomplete.async.complete:18> (( REGION_ACTIVE )) +.autocomplete.async.complete:19> [[ -v _autocomplete__isearch ]] +.autocomplete.async.complete:24> [[ self-insert == (_complete_help|list-expand|(|.)(describe-key-briefly|what-cursor-position|where-is)) ]] +.autocomplete.async.complete:28> [[ '' == *unambiguous ]] +.autocomplete.async.complete:31> .autocomplete.async.start +.autocomplete.async.complete:32> return 0 cdcd+.autocomplete.async.complete:1> .autocomplete.zle-flags self-insert +.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal cd-read cdda-player cddb_query cdparanoia cdrskin +.autocomplete.zle-flags:5> [[ -v 1 && -n self-insert ]] +.autocomplete.zle-flags:6> typeset -gH _autocomplete__last_widget=self-insert +.autocomplete.zle-flags:9> case self-insert (*kill-*~vi-*) +.autocomplete.zle-flags:9> case self-insert (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case self-insert (vi-*put-*before) +.autocomplete.zle-flags:9> case self-insert (*) +.autocomplete.zle-flags:23> return 0 +.autocomplete.async.complete:3> (( KEYS_QUEUED_COUNT || PENDING )) +.autocomplete.async.complete:6> region_highlight=( ) +.autocomplete.async.complete:7> [[ -v 'functions[_zsh_highlight]' ]] +.autocomplete.async.complete:9> typeset -gH _autocomplete__highlight=( ) +.autocomplete.async.complete:10> [[ -v 'functions[_zsh_autosuggest_highlight_apply]' ]] +.autocomplete.async.complete:13> [[ self-insert == .autocomplete.async.complete.fd-widget ]] +.autocomplete.async.complete:16> .autocomplete.async.stop +.autocomplete.async.complete:18> (( REGION_ACTIVE )) +.autocomplete.async.complete:19> [[ -v _autocomplete__isearch ]] +.autocomplete.async.complete:24> [[ self-insert == (_complete_help|list-expand|(|.)(describe-key-briefly|what-cursor-position|where-is)) ]] +.autocomplete.async.complete:28> [[ '' == *unambiguous ]] +.autocomplete.async.complete:31> .autocomplete.async.start +.autocomplete.async.complete:32> return 0 cd +.autocomplete.async.complete:1> .autocomplete.zle-flags self-insert +.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 && -n self-insert ]] +.autocomplete.zle-flags:6> typeset -gH _autocomplete__last_widget=self-insert +.autocomplete.zle-flags:9> case self-insert (*kill-*~vi-*) +.autocomplete.zle-flags:9> case self-insert (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case self-insert (vi-*put-*before) +.autocomplete.zle-flags:9> case self-insert (*) +.autocomplete.zle-flags:23> return 0 +.autocomplete.async.complete:3> (( KEYS_QUEUED_COUNT || PENDING )) +.autocomplete.async.complete:6> region_highlight=( ) +.autocomplete.async.complete:7> [[ -v 'functions[_zsh_highlight]' ]] +.autocomplete.async.complete:9> typeset -gH _autocomplete__highlight=( ) +.autocomplete.async.complete:10> [[ -v 'functions[_zsh_autosuggest_highlight_apply]' ]] +.autocomplete.async.complete:13> [[ self-insert == .autocomplete.async.complete.fd-widget ]] +.autocomplete.async.complete:16> .autocomplete.async.stop +.autocomplete.async.complete:18> (( REGION_ACTIVE )) +.autocomplete.async.complete:19> [[ -v _autocomplete__isearch ]] +.autocomplete.async.complete:24> [[ self-insert == (_complete_help|list-expand|(|.)(describe-key-briefly|what-cursor-position|where-is)) ]] +.autocomplete.async.complete:28> [[ '' == *unambiguous ]] +.autocomplete.async.complete:31> .autocomplete.async.start +.autocomplete.async.complete:32> return 0 z cd z+.autocomplete.async.complete:1> .autocomplete.zle-flags self-insert +.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 && -n self-insert ]] +.autocomplete.zle-flags:6> typeset -gH _autocomplete__last_widget=self-insert +.autocomplete.zle-flags:9> case self-insert (*kill-*~vi-*) +.autocomplete.zle-flags:9> case self-insert (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case self-insert (vi-*put-*before) +.autocomplete.zle-flags:9> case self-insert (*) +.autocomplete.zle-flags:23> return 0 +.autocomplete.async.complete:3> (( KEYS_QUEUED_COUNT || PENDING )) +.autocomplete.async.complete:6> region_highlight=( ) +.autocomplete.async.complete:7> [[ -v 'functions[_zsh_highlight]' ]] +.autocomplete.async.complete:9> typeset -gH _autocomplete__highlight=( ) +.autocomplete.async.complete:10> [[ -v 'functions[_zsh_autosuggest_highlight_apply]' ]] +.autocomplete.async.complete:13> [[ self-insert == .autocomplete.async.complete.fd-widget ]] +.autocomplete.async.complete:16> .autocomplete.async.stop +.autocomplete.async.complete:18> (( REGION_ACTIVE )) +.autocomplete.async.complete:19> [[ -v _autocomplete__isearch ]] +.autocomplete.async.complete:24> [[ self-insert == (_complete_help|list-expand|(|.)(describe-key-briefly|what-cursor-position|where-is)) ]] +.autocomplete.async.complete:28> [[ '' == *unambiguous ]] +.autocomplete.async.complete:31> .autocomplete.async.start +.autocomplete.async.complete:32> return 0 s cd zs+.autocomplete.async.complete:1> .autocomplete.zle-flags self-insert +.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 && -n self-insert ]] +.autocomplete.zle-flags:6> typeset -gH _autocomplete__last_widget=self-insert +.autocomplete.zle-flags:9> case self-insert (*kill-*~vi-*) +.autocomplete.zle-flags:9> case self-insert (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case self-insert (vi-*put-*before) +.autocomplete.zle-flags:9> case self-insert (*) +.autocomplete.zle-flags:23> return 0 +.autocomplete.async.complete:3> (( KEYS_QUEUED_COUNT || PENDING )) +.autocomplete.async.complete:6> region_highlight=( ) +.autocomplete.async.complete:7> [[ -v 'functions[_zsh_highlight]' ]] +.autocomplete.async.complete:9> typeset -gH _autocomplete__highlight=( ) +.autocomplete.async.complete:10> [[ -v 'functions[_zsh_autosuggest_highlight_apply]' ]] +.autocomplete.async.complete:13> [[ self-insert == .autocomplete.async.complete.fd-widget ]] +.autocomplete.async.complete:16> .autocomplete.async.stop +.autocomplete.async.complete:18> (( REGION_ACTIVE )) +.autocomplete.async.complete:19> [[ -v _autocomplete__isearch ]] +.autocomplete.async.complete:24> [[ self-insert == (_complete_help|list-expand|(|.)(describe-key-briefly|what-cursor-position|where-is)) ]] +.autocomplete.async.complete:28> [[ '' == *unambiguous ]] +.autocomplete.async.complete:31> .autocomplete.async.start +.autocomplete.async.complete:32> return 0 h cd zsh+.autocomplete.async.complete:1> .autocomplete.zle-flags .autocomplete.async.complete.fd-widget +.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 && -n .autocomplete.async.complete.fd-widget ]] +.autocomplete.zle-flags:6> typeset -gH _autocomplete__last_widget=.autocomplete.async.complete.fd-widget +.autocomplete.zle-flags:9> case .autocomplete.async.complete.fd-widget (*kill-*~vi-*) +.autocomplete.zle-flags:9> case .autocomplete.async.complete.fd-widget (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case .autocomplete.async.complete.fd-widget (vi-*put-*before) +.autocomplete.zle-flags:9> case .autocomplete.async.complete.fd-widget (*) +.autocomplete.zle-flags:23> return 0 +.autocomplete.async.complete:3> (( KEYS_QUEUED_COUNT || PENDING )) +.autocomplete.async.complete:6> region_highlight=( ) +.autocomplete.async.complete:7> [[ -v 'functions[_zsh_highlight]' ]] +.autocomplete.async.complete:9> typeset -gH _autocomplete__highlight=( ) +.autocomplete.async.complete:10> [[ -v 'functions[_zsh_autosuggest_highlight_apply]' ]] +.autocomplete.async.complete:13> [[ .autocomplete.async.complete.fd-widget == .autocomplete.async.complete.fd-widget ]] +.autocomplete.async.complete:14> return +.autocomplete.async.complete:1> .autocomplete.zle-flags complete-word +.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 && -n complete-word ]] +.autocomplete.zle-flags:6> typeset -gH _autocomplete__last_widget=complete-word +.autocomplete.zle-flags:9> case complete-word (*kill-*~vi-*) +.autocomplete.zle-flags:9> case complete-word (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case complete-word (vi-*put-*before) +.autocomplete.zle-flags:9> case complete-word (*) +.autocomplete.zle-flags:23> return 0 +.autocomplete.async.complete:3> (( KEYS_QUEUED_COUNT || PENDING )) +.autocomplete.async.complete:6> region_highlight=( ) +.autocomplete.async.complete:7> [[ -v 'functions[_zsh_highlight]' ]] +.autocomplete.async.complete:9> typeset -gH _autocomplete__highlight=( ) +.autocomplete.async.complete:10> [[ -v 'functions[_zsh_autosuggest_highlight_apply]' ]] +.autocomplete.async.complete:13> [[ complete-word == .autocomplete.async.complete.fd-widget ]] +.autocomplete.async.complete:16> .autocomplete.async.stop +.autocomplete.async.complete:18> (( REGION_ACTIVE )) +.autocomplete.async.complete:19> [[ -v _autocomplete__isearch ]] +.autocomplete.async.complete:24> [[ complete-word == (_complete_help|list-expand|(|.)(describe-key-briefly|what-cursor-position|where-is)) ]] +.autocomplete.async.complete:28> [[ 1 == *unambiguous ]] +.autocomplete.async.complete:31> .autocomplete.async.start +.autocomplete.async.complete:32> return 0 ```
marlonrichert commented 2 years ago

@KyleUltimate To how much did you increase the value?

marlonrichert commented 2 years ago

@CaptainJack42 @tobealive @KyleUltimate Can you try my instructions in https://github.com/marlonrichert/zsh-autocomplete/issues/441#issuecomment-1160300515, too?

JustSimplyKyle commented 2 years ago

To how much did you increase the value?

to 0.1 Also, I've successfully uncreated... the problem. It only breaks in a newly created zsh environment(the temp method) set to 0.1, after sourcing .zshrc. But at my local zsh machine, it completely works file after I set it to 0.1. Post edit, I can't create this problem anymore(no matter where I try). It seems like setting the min-delay to a higher value does have a good impact

Can you try my instructions in https://github.com/marlonrichert/zsh-autocomplete/issues/441#issuecomment-1160300515, too?

Sure, do I also need to change this zstyle ':autocomplete:*' min-delay 0.05 # float too?

CaptainJack42 commented 2 years ago

@marlonrichert

Still breaks with setting min delay to 0.1 and 0.5.

Here's the output and also the 3 log files:

Output (click to expand) ``` +.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 && -n zle-line-init ]] +.autocomplete.zle-flags:6> typeset -gH _autocomplete__last_widget=zle-line-init +.autocomplete.zle-flags:9> case zle-line-init (*kill-*~vi-*) +.autocomplete.zle-flags:9> case zle-line-init (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case zle-line-init (vi-*put-*before) +.autocomplete.zle-flags:9> case zle-line-init (*) +.autocomplete.zle-flags:23> return 0 +.autocomplete.async.complete:1> .autocomplete.zle-flags zle-line-finish +.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 && -n zle-line-finish ]] +.autocomplete.zle-flags:6> typeset -gH _autocomplete__last_widget=zle-line-finish +.autocomplete.zle-flags:9> case zle-line-finish (*kill-*~vi-*) +.autocomplete.zle-flags:9> case zle-line-finish (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case zle-line-finish (vi-*put-*before) +.autocomplete.zle-flags:9> case zle-line-finish (*) +.autocomplete.zle-flags:23> return 0 +.autocomplete.async.complete:3> (( KEYS_QUEUED_COUNT || PENDING )) +.autocomplete.async.complete:6> region_highlight=( ) +.autocomplete.async.complete:7> [[ -v 'functions[_zsh_highlight]' ]] +.autocomplete.async.complete:8> _zsh_highlight +.autocomplete.async.complete:9> typeset -gH _autocomplete__highlight=( '0 9 fg=green memo=zsh-syntax-highlighting' '10 12 none memo=zsh-syntax-highlighting' '13 41 none memo=zsh-syntax-highlighting' '42 65 none memo=zsh-syntax-highlighting' ) +.autocomplete.async.complete:10> [[ -v 'functions[_zsh_autosuggest_highlight_apply]' ]] +.autocomplete.async.complete:11> _zsh_autosuggest_highlight_apply +.autocomplete.async.complete:13> [[ zle-line-finish == .autocomplete.async.complete.fd-widget ]] +.autocomplete.async.complete:16> .autocomplete.async.stop +.autocomplete.async.complete:18> (( REGION_ACTIVE )) +.autocomplete.async.complete:19> [[ -v _autocomplete__isearch ]] +.autocomplete.async.complete:24> [[ zle-line-finish == (_complete_help|list-expand|(|.)(describe-key-briefly|what-cursor-position|where-is)) ]] +.autocomplete.async.complete:28> [[ '' == *unambiguous ]] +.autocomplete.async.complete:31> .autocomplete.async.start +.autocomplete.async.complete:32> return 0 +.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 && -n self-insert ]] Music/ Pictures/ Projects/ Public/ Templates/ Videos/ arco-i3/ cloud/ git/ mnt/ qemu/ thesis/ +.autocomplete.zle-flags:6> typeset -gH _autocomplete__last_widget=self-insert +.autocomplete.zle-flags:9> case self-insert (*kill-*~vi-*) +.autocomplete.zle-flags:9> case self-insert (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case self-insert (vi-*put-*before) +.autocomplete.zle-flags:9> case self-insert (*) +.autocomplete.zle-flags:23> return 0 +.autocomplete.async.complete:1> .autocomplete.zle-flags self-insert +.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 && -n self-insert ]] +.autocomplete.zle-flags:6> typeset -gH _autocomplete__last_widget=self-insert +.autocomplete.zle-flags:9> case self-insert (*kill-*~vi-*) +.autocomplete.zle-flags:9> case self-insert (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case self-insert (vi-*put-*before) +.autocomplete.zle-flags:9> case self-insert (*) +.autocomplete.zle-flags:23> return 0 +.autocomplete.async.complete:3> (( KEYS_QUEUED_COUNT || PENDING )) +.autocomplete.async.complete:6> region_highlight=( ) +.autocomplete.async.complete:7> [[ -v 'functions[_zsh_highlight]' ]] +.autocomplete.async.complete:8> _zsh_highlight +.autocomplete.async.complete:9> typeset -gH _autocomplete__highlight=( '0 1 underline memo=zsh-syntax-highlighting' ) +.autocomplete.async.complete:10> [[ -v 'functions[_zsh_autosuggest_highlight_apply]' ]] +.autocomplete.async.complete:11> _zsh_autosuggest_highlight_apply +.autocomplete.async.complete:13> [[ self-insert == .autocomplete.async.complete.fd-widget ]] +.autocomplete.async.complete:16> .autocomplete.async.stop +.autocomplete.async.complete:18> (( REGION_ACTIVE )) +.autocomplete.async.complete:19> [[ -v _autocomplete__isearch ]] +.autocomplete.async.complete:24> [[ self-insert == (_complete_help|list-expand|(|.)(describe-key-briefly|what-cursor-position|where-is)) ]] +.autocomplete.async.complete:28> [[ '' == *unambiguous ]] +.autocomplete.async.complete:31> .autocomplete.async.start +.autocomplete.async.complete:32> return 0 c+.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 ]] +.autocomplete.zle-flags:9> case self-insert (*kill-*~vi-*) +.autocomplete.zle-flags:9> case self-insert (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case self-insert (vi-*put-*before) +.autocomplete.zle-flags:9> case self-insert (*) +.autocomplete.zle-flags:23> return 0 coc+.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 && -n self-insert ]] compadd compaudit compdef compdump compgen compinit compinstall complete current_branch +.autocomplete.zle-flags:6> typeset -gH _autocomplete__last_widget=self-insert +.autocomplete.zle-flags:9> case self-insert (*kill-*~vi-*) +.autocomplete.zle-flags:9> case self-insert (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case self-insert (vi-*put-*before) +.autocomplete.zle-flags:9> case self-insert (*) +.autocomplete.zle-flags:23> return 0 +.autocomplete.async.complete:1> .autocomplete.zle-flags self-insert +.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 && -n self-insert ]] +.autocomplete.zle-flags:6> typeset -gH _autocomplete__last_widget=self-insert +.autocomplete.zle-flags:9> case self-insert (*kill-*~vi-*) +.autocomplete.zle-flags:9> case self-insert (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case self-insert (vi-*put-*before) +.autocomplete.zle-flags:9> case self-insert (*) +.autocomplete.zle-flags:23> return 0 +.autocomplete.async.complete:3> (( KEYS_QUEUED_COUNT || PENDING )) +.autocomplete.async.complete:6> region_highlight=( ) +.autocomplete.async.complete:7> [[ -v 'functions[_zsh_highlight]' ]] +.autocomplete.async.complete:8> _zsh_highlight +.autocomplete.async.complete:9> typeset -gH _autocomplete__highlight=( '0 2 fg=green memo=zsh-syntax-highlighting' ) +.autocomplete.async.complete:10> [[ -v 'functions[_zsh_autosuggest_highlight_apply]' ]] +.autocomplete.async.complete:11> _zsh_autosuggest_highlight_apply +.autocomplete.async.complete:13> [[ self-insert == .autocomplete.async.complete.fd-widget ]] +.autocomplete.async.complete:16> .autocomplete.async.stop +.autocomplete.async.complete:18> (( REGION_ACTIVE )) +.autocomplete.async.complete:19> [[ -v _autocomplete__isearch ]] +.autocomplete.async.complete:24> [[ self-insert == (_complete_help|list-expand|(|.)(describe-key-briefly|what-cursor-position|where-is)) ]] +.autocomplete.async.complete:28> [[ '' == *unambiguous ]] +.autocomplete.async.complete:31> .autocomplete.async.start +.autocomplete.async.complete:32> return 0 cd+.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 ]] +.autocomplete.zle-flags:9> case self-insert (*kill-*~vi-*) +.autocomplete.zle-flags:9> case self-insert (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case self-insert (vi-*put-*before) +.autocomplete.zle-flags:9> case self-insert (*) +.autocomplete.zle-flags:23> return 0 xcd+.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 && -n complete-word ]]layer cddb_query cdparanoia cdr2raw cdr2text cdr2xhtml cdrskin cdrwtool +.autocomplete.zle-flags:6> typeset -gH _autocomplete__last_widget=complete-word +.autocomplete.zle-flags:9> case complete-word (*kill-*~vi-*) +.autocomplete.zle-flags:9> case complete-word (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case complete-word (vi-*put-*before) +.autocomplete.zle-flags:9> case complete-word (*) +.autocomplete.zle-flags:23> return 0 +.autocomplete.async.complete:1> .autocomplete.zle-flags .autocomplete.async.complete.fd-widget +.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 && -n .autocomplete.async.complete.fd-widget ]] +.autocomplete.zle-flags:6> typeset -gH _autocomplete__last_widget=.autocomplete.async.complete.fd-widget +.autocomplete.zle-flags:9> case .autocomplete.async.complete.fd-widget (*kill-*~vi-*) +.autocomplete.zle-flags:9> case .autocomplete.async.complete.fd-widget (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case .autocomplete.async.complete.fd-widget (vi-*put-*before) +.autocomplete.zle-flags:9> case .autocomplete.async.complete.fd-widget (*) +.autocomplete.zle-flags:23> return 0 +.autocomplete.async.complete:3> (( KEYS_QUEUED_COUNT || PENDING )) +.autocomplete.async.complete:6> region_highlight=( ) +.autocomplete.async.complete:7> [[ -v 'functions[_zsh_highlight]' ]] +.autocomplete.async.complete:8> _zsh_highlight +.autocomplete.async.complete:9> typeset -gH _autocomplete__highlight=( '0 8 fg=green memo=zsh-syntax-highlighting' '8 9 bold memo=zsh-syntax-highlighting' ) +.autocomplete.async.complete:10> [[ -v 'functions[_zsh_autosuggest_highlight_apply]' ]] +.autocomplete.async.complete:11> _zsh_autosuggest_highlight_apply +.autocomplete.async.complete:13> [[ .autocomplete.async.complete.fd-widget == .autocomplete.async.complete.fd-widget ]] +.autocomplete.async.complete:14> return +.autocomplete.async.complete:1> .autocomplete.zle-flags complete-word +.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 && -n complete-word ]] +.autocomplete.zle-flags:6> typeset -gH _autocomplete__last_widget=complete-word +.autocomplete.zle-flags:9> case complete-word (*kill-*~vi-*) +.autocomplete.zle-flags:9> case complete-word (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case complete-word (vi-*put-*before) +.autocomplete.zle-flags:9> case complete-word (*) +.autocomplete.zle-flags:23> return 0 +.autocomplete.async.complete:3> (( KEYS_QUEUED_COUNT || PENDING )) +.autocomplete.async.complete:6> region_highlight=( ) +.autocomplete.async.complete:7> [[ -v 'functions[_zsh_highlight]' ]] +.autocomplete.async.complete:8> _zsh_highlight +.autocomplete.async.complete:9> typeset -gH _autocomplete__highlight=( '0 8 fg=green memo=zsh-syntax-highlighting' '8 9 bold memo=zsh-syntax-highlighting' ) +.autocomplete.async.complete:10> [[ -v 'functions[_zsh_autosuggest_highlight_apply]' ]] +.autocomplete.async.complete:11> _zsh_autosuggest_highlight_apply +.autocomplete.async.complete:13> [[ complete-word == .autocomplete.async.complete.fd-widget ]] +.autocomplete.async.complete:16> .autocomplete.async.stop +.autocomplete.async.complete:18> (( REGION_ACTIVE )) +.autocomplete.async.complete:19> [[ -v _autocomplete__isearch ]] +.autocomplete.async.complete:24> [[ complete-word == (_complete_help|list-expand|(|.)(describe-key-briefly|what-cursor-position|where-is)) ]] +.autocomplete.async.complete:28> [[ '1 ' == *unambiguous ]] +.autocomplete.async.complete:31> .autocomplete.async.start +.autocomplete.async.complete:32> return 0 cd-drive +.autocomplete.zle-flags:1> emulate -L zsh +.autocomplete.zle-flags:2> setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset warncreateglobal +.autocomplete.zle-flags:5> [[ -v 1 ]] +.autocomplete.zle-flags:9> case complete-word (*kill-*~vi-*) +.autocomplete.zle-flags:9> case complete-word (*yank*~vi-*|vi-*put-*after|bracketed-paste) +.autocomplete.zle-flags:9> case complete-word (vi-*put-*before) +.autocomplete.zle-flags:9> case complete-word (*) +.autocomplete.zle-flags:23> return 0 cd-drive ```

2022-06-30.async.log 2022-06-30.log 2022-06-30.pty.log

marlonrichert commented 2 years ago

Thanks, that's interesting output. It looks like the async completion does finish successfully, but for some reason, the callback widget is never triggered. I wonder if the callback/file descriptor gets unhooked/closed prematurely.

Can you try the following?

  1. In your test environment, run the following:
    PS4=$_autocomplete__ps4
    setopt promptsubst
    functions -t .autocomplete.async.stop .autocomplete.async.start
  2. Reproduce the bug and note the time at which it occured.
  3. Share your output (in a file, preferably) and the time of the bug here.
CaptainJack42 commented 2 years ago

@marlonrichert

2022-07-01-log.log

Here's the output.

The bug appeared after the usual cd into/long/path and than deleting the command by holding backspace.

marlonrichert commented 2 years ago

Thanks. It didn’t produce any useful output, though.

hgw77 commented 2 years ago

a small question, with Autosuggestion stops working do you mean the fish-like type ahead autosuggestion? If yes I can report that on debian linux-gnu /usr/bin/zsh debian/5.8-6+deb11u1 this is also not working

Mordna commented 2 years ago

It seems like the commit b0bd14035 (2021-04-21) for zsh is the first one which yields this behavior (the previous commit e7711e37e of zsh did not produce this bug). This commit changed zmathfunc, so maybe a calculation (in zsh-autocomplete) is erroneous?

Edit: Interestingly, trying to debug it, using set -x and a trap function to redirect the debug output to a file, did not produce any results because the bug no longer occurred. The only change should be the increased delay due to debugging.

blueray453 commented 2 years ago

Here are few of my log files.

2022-08-04.pty.log 2022-08-09.pty.log 2022-08-11.pty.log 2022-08-10.pty.log 2022-08-05.log

marlonrichert commented 2 years ago

@blueray453 They show a lot of input/output errors. What were you trying to complete?

blueray453 commented 2 years ago

The terminal kept closing down (goes away) in the middle of my work (automatically triggering suggestion functions which have bugs). Then i went through the code and found that there are logs. I checked the logs and they are not descriptive. They do not say, which error, when, what etc. At some point the extension became unusable.

Then i came up with my own completion taking hint from your extension.

# Should be called before compinit
zmodload zsh/complist

autoload -Uz compinit && compinit

zstyle ':completion:*' use-cache on

zstyle ':completion:*' accept-exact '*(N)'

compdef _gnu_generic bat
compdef _gnu_generic broot
compdef br=broot
compdef _gnu_generic exa
compdef _gnu_generic fd
# compdef _gnu_generic lf
compdef _gnu_generic rg
compdef _gnu_generic sd
compdef _gnu_generic rofi

# show modified files in completion
zstyle ':completion::complete:git-diff*:argument-rest:tree-files' command 'git ls-files -m'

# Change tag order
zstyle :completion::complete:git-diff:argument-rest: group-order modified-files files
zstyle :completion::complete:git-difftool:argument-rest: group-order modified-files files

setopt MENU_COMPLETE        # Automatically highlight first element of completion menu
setopt AUTO_LIST            # Automatically list choices on ambiguous completion.
setopt COMPLETE_IN_WORD     # Complete from both ends of a word.

# Define completers
# zstyle ':completion:*' completer _expand _alias _complete _ignored
zstyle ':completion:*' completer _extensions _complete _approximate

# menu selection
zstyle ':completion:*' menu yes select=2 # select completions with arrow keys
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s

zstyle ':completion:*:*:*:*:corrections' format '%F{yellow}!- %d (errors: %e) -!%f'
zstyle ':completion:*:*:*:*:descriptions' format '%F{blue}-- %D %d --%f'
zstyle ':completion:*:*:*:*:messages' format ' %F{purple} -- %d --%f'
zstyle ':completion:*:*:*:*:warnings' format ' %F{red}-- no matches found --%f'
zstyle ':completion:*:default' list-prompt '%S%M matches%s'

zstyle ':completion:*' max-errors 2

# Colors for files and directory
zstyle ':completion:*:*:*:*:default' list-colors ${(s.:.)LS_COLORS}

# Kill Command
zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'

# Only display some tags for the command cd
zstyle ':completion:*:*:cd:*' tag-order local-directories directory-stack path-directories

# Required for completion to be in good groups (named after the tags)
zstyle ':completion:*' group-name '' # group results by category

zstyle ':completion:*:*:-command-:*:*' group-order aliases builtins functions commands

# See ZSHCOMPWID "completion matching control"
zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'

zstyle ':completion:*' keep-prefix true

zstyle -e ':completion:*:(ssh|scp|sftp|rsh|rsync):hosts' hosts 'reply=(${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) /dev/null)"}%%[# ]*}//,/ })'

bindkey "^U" history-substring-search-down

zstyle ':completion:*' insert-tab false

# complete man pages
zstyle ':completion:*:manuals' separate-sections true
zstyle ':completion:*:manuals.(^1*)' insert-sections true

zstyle ':completion:*' list-separator '#'

It is serving me very well. It is also compatible with both

https://github.com/zsh-users/zsh-autosuggestions https://github.com/zsh-users/zsh-history-substring-search

I am not an expert and sure there are few issues with this config. Please give the configs which your extension renders to. That way i would be able to make mine better.

ad-on-is commented 2 years ago

For me, this issue also occurs when calling the history a few times.

Steps to reproduce

  1. Ctrl+R
  2. Type something
  3. Ctrl+C to cancel
  4. (Repeat 1-3) ... I had to do it ~ 6-7 times
  5. Ctrl+R stops working (history not popping up) and zsh-autocomplete stops working overall
OS: EndeavourOS Linux x86_64 
Kernel: 6.0.2-arch1-1 
Uptime: 16 hours, 2 mins 
Packages: 2269 (pacman), 28 (flatpak) 
Shell: zsh 5.9 
Resolution: 3440x1440, 3440x1440, 1080x1920, 1080x1920 
WM: awesome 
Theme: Catppuccin-Mocha [GTK2/3] 
Icons: candy-icons [GTK2/3] 
Terminal: kitty 
CPU: AMD Ryzen 7 5800X (16) @ 3.800GHz 
GPU: AMD ATI Radeon RX 6700/6700 XT/6750 XT / 6800M 
Memory: 9664MiB / 32011MiB 

Edit: Downgrading zsh to 5.8.1 works flawlessly

marlonrichert commented 2 years ago

I'm still unable to reproduce this, not on my Intel Mac and not on my Intel PC running Ubuntu.

Is there anyone here who could try to debug this?

ad-on-is commented 2 years ago

I'm still unable to reproduce this, not on my Intel Mac and not on my Intel PC running Ubuntu.

Is there anyone here who could try to debug this?

I think I might have found the problem.

scripts/.autocomplete.async line 214

I changed it from

zselect -t "$(( [#10] 100 * max( 0, min_delay - SECONDS ) ))"

to

zselect -t "$(( [#10] 100 * 0.05 ))

and havent had an issue since.

I don't know what other issue this may cause, but as @Mordna pointed out about zmathfunc, I focused on all min/max calls and just tried changing stuff randomly :-D)

rayjanoka commented 2 years ago

zselect -t "$(( [#10] 100 * 0.05 ))"

it does seem like that did the trick! thx @ad-on-is

ad-on-is commented 2 years ago

zselect -t "$(( [#10] 100 * 0.05 ))"

it does seem like that did the trick! thx @ad-on-is

I'd still suggest @marlonrichert to take a look at it.. the line should probably be something like: zselect -t "$(( [#10] 100 * min_delay )), since min_delay is configurable.