Skip to content

feat: PowerShell Wrapper via cdd init powershell #45

Description

@hammadmajid

What problem are you trying to solve?

cdd init supports fish, bash, and zsh only. PowerShell users, on Windows and on Linux and macOS with pwsh, cannot Jump: the binary prints a path but there is no Wrapper to change the caller's directory.

Proposed solution

Add powershell (alias pwsh) to cdd init, emitting a function that starship and zoxide have already proven works:

Invoke-Expression (& cdd init powershell | Out-String)

The emitted cdd function forwards the pass-through subcommands (help, completion, init, scan, version) to the binary, otherwise captures & cdd pick @args, checks $LASTEXITCODE, guards against an empty result, and runs Set-Location -LiteralPath. The pass-through list continues to come from the cobra command tree.

Alternatives considered

  • Asking users to write their own function. Defeats the cdd init <shell> contract.

Additional context

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestneeds-triageMaintainer needs to evaluate this issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions