zsh-autocomplete: Autosuggestion stops functioning with zsh 5.9 after a few directory changes

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
  • Operating system: macOS
  • Terminal emulator: iTerm

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

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 56 (25 by maintainers)

Commits related to this issue

Most upvoted comments

foo=0.1 bar=0.001 print $(( [#10] 100 * max( 0, foo - bar ) ))

Results in 0

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

Does not work

local -i timeout=$(( 100 * max( 0, min_delay - SECONDS ) )) zselect -t $timeout

Works!

I wonder if [#10] in Zsh 5.9 causes the return value of max to be converted to int before being multiplied by 100?

That seems to be the case.

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.

What happens if you try to replicate this on the command line? For example:

foo=0.1
bar=0.001
print $(( [#10] 100 * max( 0, foo - bar ) ))

Does it print 9 or 0?

I wonder if [#10] in Zsh 5.9 causes the return value of max to be converted to int before being multiplied by 100?

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

What if you instead try

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

Does that work correctly?

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

I’d prefer something like this:

local -i timeout=$(( 100 * max( 0, min_delay - SECONDS ) ))
zselect -t $timeout

Can you test if that works?

As an aside, I’m planning to rewrite that part of the code. It’s a rather naive implementation. I have not yet been able to find time for it, though.

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.

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 😄)

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
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

@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

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.

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.

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