Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Available completions not shown for commands with slow compdef functions #713

Open
ethantkoenig opened this issue Apr 9, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ethantkoenig
Copy link

ethantkoenig commented Apr 9, 2024

Environment

% typeset -p1 VENDOR OSTYPE ZSH_PATCHLEVEL _autocomplete__funcfiletrace
typeset VENDOR=apple
typeset OSTYPE=darwin23.0
typeset ZSH_PATCHLEVEL=zsh-5.9-0-g73d3173
typeset -a _autocomplete__funcfiletrace=(
  /var/folders/wn/hb12b9pd7vvcghywcg1npbgh0000gp/T/tmp.SOEDKKuKg2/zsh-autocomplete/zsh-autocomplete.plugin.zsh:4
  /var/folders/wn/hb12b9pd7vvcghywcg1npbgh0000gp/T/tmp.SOEDKKuKg2/.zshrc:5
  zsh:0
)
% git -C ~autocomplete log --oneline -n1
1968100 (grafted, HEAD -> main, origin/main, origin/HEAD) Fix bugs in `recent-paths` widget
  • Operating system: macOS Sonoma 14.4.1
  • Terminal emulator: Terminal.app

Steps to reproduce

% cd $(mktemp -d)
% git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git
<output>
% > .zshrc <<EOF
setopt interactivecomments transientrprompt
PS1='%# '
PS2=
RPS2='%^'
source $PWD/zsh-autocomplete/zsh-autocomplete.plugin.zsh
EOF
% env -i HOME=$PWD PATH=$PATH TERM=$TERM ${TERMINFO:+TERMINFO=$TERMINFO} zsh -d
% _fast_foo() { local -a subcmds; subcmds=('a:1' 'b:2'); _describe 'command' subcmds }
% _slow_foo() { sleep 1; _fast_foo }
% compdef _fast_foo fast_foo
% compdef _slow_foo slow_foo
% fast_foo  # <-- available completions are displayed after typing space past "fast_foo"
command
a  -- 1
b  -- 2
% slow_foo  # <-- available completions are not displayed

Verified that ~autocomplete-log/2024-04-08.log is empty (after running the above commands):

% ls -s ~autocomplete-log/2024-04-08.log
0 /var/folders/wn/hb12b9pd7vvcghywcg1npbgh0000gp/T/tmp.SOEDKKuKg2/.local/state/zsh-autocomplete/log/2024-04-08.log
@ethantkoenig ethantkoenig added the bug Something isn't working label Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant