Skip to content

feat: nushell Wrapper via cdd init nu #46

Description

@hammadmajid

What problem are you trying to solve?

cdd init supports fish, bash, and zsh only. Nushell users cannot Jump: the binary prints a path but there is no Wrapper to change the caller's directory.

Proposed solution

Add nu (alias nushell) to cdd init. Nushell cannot source from a pipe, so follow the pattern starship and zoxide use: the user writes the script to a file once and sources it from config.nu:

cdd init nu | save -f ~/.cache/cdd/init.nu
source ~/.cache/cdd/init.nu

The emitted script defines def --env cdd [...args] so cd affects the caller. It forwards pass-through subcommands to the binary with ^cdd, otherwise captures ^cdd pick ...$args | str trim, checks the exit code, guards against an empty result, and runs cd.

Alternatives considered

  • Nushell plugins. Far heavier than a two-line function.

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