Skip to content

feat(shell): complete cd -jw with native shell candidates #40

Closed

Description

@benbenbang

Parent

Part of #43.

Summary

Refine worktree Tab completion so the shell receives candidate paths instead of cj launching an interactive fzf process from inside completion.

Interaction

  1. Type cd -jw or cd --jump-worktree.
  2. Press Tab.
  3. The generated integration asks cj for this repository's worktree paths.
  4. The shell presents those candidates using its normal completion UI.
  5. The chosen worktree safely replaces the jump token; Enter performs the directory change.

With fzf-tab or another completion frontend installed, that frontend can render the worktree candidates through fzf. Without fzf, native completion still works.

Acceptance criteria

  • included by cj init <shell> without --setup-key-binding
  • support Bash, Zsh, Nushell, and PowerShell
  • return only worktree path candidates for an exact current -jw or --jump-worktree token
  • do not launch a nested fzf process during Tab completion
  • preserve exact paths and shell-safe insertion for spaces, apostrophes, Unicode, leading dashes, platform-native separators, and non-UTF-8 Unix paths where the shell permits them
  • cancellation or an empty candidate set leaves the buffer and current directory unchanged
  • ordinary cd completion delegates to the existing shell-specific behavior
  • Zsh registration remains effective when compinit and fzf-tab/plugin frameworks initialize before or after the generated integration
  • cj -jw and cd -jw<Enter> remain explicit fzf picker paths and retain useful missing-fzf diagnostics
  • standalone cj completions behavior remains separate; wrapper completion stays in generated init
  • native, generated-source, external integration, and Windows CI tests are green

Scope note

This supersedes the original direct-fzf-on-Tab wording after interactive testing exposed nested/ordinary completion behavior. Reuse the existing shell hooks, quoting, and tests from PR #41 where they still fit.

Activity

  1. added 4 commits that reference this issue on Sep 7, 2026
    4a3a1fe
    a2c6165
    afa8dda
    4c7ecf0
  2. changed the title [-]feat(shell): complete cd -jw through fzf[/-] [+]feat(shell): complete cd -jw with native shell candidates[/+] on Sep 7, 2026
  3. ptah-bw-technical-app commented on Sep 10, 2026

    @ptah-bw-technical-app
    Contributor

    🎉 This issue has been resolved in version 0.4.0 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions