Skip to content

fix(completions): complete script paths for bare deno run in zsh - #36976

Merged
bartlomieju merged 1 commit into
mainfrom
fix/zsh-completions-bare-run
Oct 6, 2026
Merged

bartlomieju merged 1 commit into
mainfrom
fix/zsh-completions-bare-run

Conversation

@bartlomieju

Copy link
Copy Markdown
Member

The zsh completion script didn't account for the bare deno [flags] <script>
form, which runs the default run subcommand. The first positional only
offered subcommands, and the case $line[1] dispatch had no fallback, so
deno -A ./<TAB> and deno ./<TAB> produced nothing but a beep while
deno run -A ./<TAB> worked.

When the root command has a default subcommand, the first positional now
completes subcommands and files, any other leading word falls back to file
completion, and the default subcommand's visible flags are offered at the root.
Flag specs are rendered through one helper, so subcommand flags also get their
short forms.

Fixes #36959

@bartlomieju
bartlomieju merged commit a18ce33 into main Oct 6, 2026
135 checks passed
@bartlomieju
bartlomieju deleted the fix/zsh-completions-bare-run branch October 6, 2026 18:51
bartlomieju added a commit that referenced this pull request Oct 21, 2026
NetOpWibby pushed a commit to theende/ende that referenced this pull request Nov 7, 2026
The zsh script only offered subcommands for the first positional and
nothing after a non-subcommand word, so `ende -A ./<TAB>` never completed a
script path. The first positional now completes subcommands or files, and
the default subcommand's flags are accepted at the root.

(cherry picked from commit a18ce33)
(cherry picked from commit 2a7f724fb97057cce98dd7c4a628b68320ee3820)

Upstream: denoland/deno#36976
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

zsh: deno -A + Tab filename completions broken

1 participant