Skip to content

Add PowerShell tab completions (0.6.0) - #8

Merged
bordoni merged 1 commit into
mainfrom
release/0.6.0
Oct 16, 2026
Merged

bordoni merged 1 commit into
mainfrom
release/0.6.0

Conversation

@bordoni

@bordoni bordoni commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

claudep completion powershell prints a native argument completer generated from the COMMANDS table, like the zsh, bash and fish scripts. It completes subcommands (with their descriptions as tooltips), flags, the values --shell, shell-init and completion take, and profile names read with Get-ChildItem when Tab is pressed, so bun never starts. Load it from $PROFILE:

claudep completion powershell | Out-String | Invoke-Expression

A bare claudep completion in PowerShell on Windows now prints this script instead of refusing.

What the Windows job found

This PR exists to run Windows PowerShell 5.1 before tagging. Two things came out of it:

  • The test needed claudep on PATH. Without it, each TabExpansion2 call searched PATH and module auto-loading for the command: 17 s under pwsh and past the 30 s limit under 5.1 on the Windows runner. With a claudep on PATH, as an install has, pwsh takes 0.71 s and 5.1 takes 2.9 s.
  • 5.1 never calls a native completer for a bare -, -- or -x word. A temporary probe (dropped from the branch) showed 5.1.26100 sends those to its own parameter completion. --e and every non-dash word reach the completer as in pwsh 7.6. The README tells 5.1 users to type the first letter of a flag, and the test asserts each shell's behaviour.

CI is green on macOS, Ubuntu and Windows. Once merged, main is fast-forwarded to this branch and bun run release minor --push cuts 0.6.0.

Docs

README, help text, [Unreleased] in CHANGELOG.md, .ref/testing.md, and a 2026-10-14 entry in .ref/design-decisions.md that reopens the PowerShell part of the 2026-09-14 completion decision.

A fourth generator next to zsh, bash and fish, built from the same
COMMANDS table. It registers a native argument completer, so it works in
pwsh and Windows PowerShell 5.1, and offers subcommands with their
descriptions as tooltips, flags, the --shell, shell-init and completion
values, and profile names read with Get-ChildItem when Tab is pressed.
Positions the table does not describe fall through to PowerShell's own
path completion.

Windows PowerShell 5.1 never calls a native completer for a bare -, --
or -x word, as a probe on the Windows runner showed, so there a flag
completes from its first letter (--e<Tab>). The README says so and the
test asserts both shells' behaviour.

A bare claudep completion in PowerShell on Windows now prints the
script instead of refusing. test/completion.test.ts drives the
completer through TabExpansion2 under pwsh on every OS and under
Windows PowerShell 5.1 on Windows, with claudep on PATH: without it
each Tab searched PATH and module auto-loading for the command, 17 s
under pwsh on the Windows runner. Reopens the PowerShell part of the
2026-09-14 completion decision.
@bordoni
bordoni merged commit 65d1a5a into main Oct 16, 2026
5 checks passed
@bordoni
bordoni deleted the release/0.6.0 branch October 17, 2026 13:06
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.

1 participant