Skip to content

fix(cli): complete tasks from the -C target directory - #3609

Open
voidzero-bot[bot] wants to merge 1 commit into
mainfrom
triagebot/fix-3608
Open

voidzero-bot[bot] wants to merge 1 commit into
mainfrom
triagebot/fix-3608

Conversation

@voidzero-bot

@voidzero-bot voidzero-bot Bot commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

vp -C <dir> run completed tasks from the invocation directory instead of the -C target: vp -C dev run review-<TAB> offered nothing, and vp -C ./dev run review-<TAB> offered the root project's tasks, while actually running the task worked from either spelling.

Two defects in the global CLI completion path caused this. The shell glue invokes the completer as vp -- <bin> <words...>, so the leading -C <dir> hid behind the -- separator and the pre-completion parse_leading_chdir peek never matched it — cwd-sensitive completers (vp run tasks) stayed in the invocation directory. Separately, clap_complete's engine matches words against subcommand names before consuming a pending option value, so a directory named like a subcommand (dev, build, ...) routed the completion into that subcommand and produced no candidates at all.

complete_request() now drives the completion via CompleteEnv::try_complete, first consuming the leading -C <dir> from the completion words (applying it with the existing apply_chdir) and rewriting the bare separate value to a path spelling (dev -> ./dev) so the engine consumes it as the option value instead of a subcommand name. The word count is unchanged, so every shell's cursor-index derivation keeps working (bash/zsh export _CLAP_COMPLETE_INDEX; fish and PowerShell use the last word), and requests that are still completing the -C flag or its value pass through untouched.

Closes #3608

Automated triage bot fix (AI-assisted).

@github-actions

Copy link
Copy Markdown
Contributor

CLI artifact sizes (8d1c317)

Final release artifacts built by the canonical build-upstream and build-windows-cli actions.
The dist rows use the Linux build. The core total excludes .node files to match the release artifact.

Artifact Format Base PR Change
packages/cli/dist Directory total 2.40 MiB 2.40 MiB 0 B (0.00%)
packages/core/dist Directory total 4.11 MiB 4.11 MiB 0 B (0.00%)
Combined package dist Directory total 6.51 MiB 6.51 MiB 0 B (0.00%)
vp (Linux x64) Binary 9.11 MiB 9.11 MiB 0 B (0.00%)
vp (Linux x64) gzip -9 4.18 MiB 4.18 MiB +16 B (+0.00%)
NAPI (Linux x64) Binary 37.34 MiB 37.34 MiB 0 B (0.00%)
NAPI (Linux x64) gzip -9 14.93 MiB 14.93 MiB 0 B (0.00%)
vp (macOS ARM64) Binary 5.99 MiB 5.99 MiB 0 B (0.00%)
vp (macOS ARM64) gzip -9 3.57 MiB 3.57 MiB -86 B (-0.00%)
NAPI (macOS ARM64) Binary 43.86 MiB 43.86 MiB 0 B (0.00%)
NAPI (macOS ARM64) gzip -9 19.06 MiB 19.06 MiB 0 B (0.00%)
vp (Windows x64) Binary 7.11 MiB 7.11 MiB 0 B (0.00%)
vp (Windows x64) gzip -9 3.26 MiB 3.26 MiB -73 B (-0.00%)
NAPI (Windows x64) Binary 33.28 MiB 33.28 MiB 0 B (0.00%)
NAPI (Windows x64) gzip -9 13.65 MiB 13.65 MiB +2 B (+0.00%)
Trampoline (Windows x64) Binary 13.50 KiB 13.50 KiB 0 B (0.00%)
Trampoline (Windows x64) gzip -9 7.09 KiB 7.09 KiB +1 B (+0.01%)
Installer (Windows x64) Binary 4.69 MiB 4.69 MiB 0 B (0.00%)
Installer (Windows x64) gzip -9 2.25 MiB 2.25 MiB 0 B (0.00%)

@cloudflare-workers-and-pages

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://triagebot-fix-3608-viteplus-dev.voidzero-docs.workers.dev (commit 8d1c317)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://54638488-viteplus-dev.voidzero-docs.workers.dev 8d1c317 2026-11-29T14:46:57.972Z Visit the dashboard ↗

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vp -C dev run gives no Bash task completions when the directory is named dev

0 participants