Skip to content

feat(completion): add PowerShell shell integration#67

Open
jganoff wants to merge 3 commits into
mainfrom
feat/powershell-completion
Open

feat(completion): add PowerShell shell integration#67
jganoff wants to merge 3 commits into
mainfrom
feat/powershell-completion

Conversation

@jganoff
Copy link
Copy Markdown
Owner

@jganoff jganoff commented May 30, 2026

Summary

  • Add wsp completion powershell output: a wsp function wrapper and a Register-ArgumentCompleter scriptblock
  • Use non-native registration so the completer fires for the function, not just the external executable
  • Handle PowerShell 5.1's empty-arg-drop bug via the --% stop-parsing token
  • Add shell-spawning integration tests for both Windows (powershell.exe) and Unix (bash)
  • Add persistent setup instructions to wsp completion --help

Setup

Add to your PowerShell profile ($PROFILE):

Invoke-Expression (wsp completion powershell | Out-String)

Test plan

  • wsp completion powershell outputs a valid script
  • Sourcing the script in PowerShell enables tab completion for wsp subcommands and workspace names
  • wsp <TAB> works (empty-word completion via --% fix)
  • Integration tests pass on Windows and Linux

🤖 Generated with Claude Code

jganoff and others added 3 commits May 30, 2026 14:34
Adds wsp completion powershell output: a wsp function wrapper and a
Register-ArgumentCompleter scriptblock. Uses non-native registration so
the completer fires for the function, not just external executables.
Handles PS 5.1's empty-arg-drop bug via the --% stop-parsing token.
Includes shell-spawning integration tests on both Windows (powershell.exe)
and Unix (bash).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fix New-Item help text indentation (used \x20\x20 to survive Rust line-continuation whitespace stripping)
- Fix wsp new and wsp recover to skip flag args when finding workspace name to cd into (same pattern as wsp rm)
- Replace Invoke-Expression in non-empty completion branch with direct & binary -- @tokens using CommandElements, preventing $() injection via user-typed argument values
- Scope $argStr + cursor-truncation inside the empty-word branch only (still needed there for the --% PS 5.1 fix)
- Add TODO comment for unimplemented shell hooks in generate_powershell
- Add regression tests for new/recover flag-skip behaviour and updated completion branch assertions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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