worktrunk icon indicating copy to clipboard operation
worktrunk copied to clipboard

Interactive switching…

Open eric-g-97477 opened this issue 8 months ago • 1 comments

What I would love to see is writing wt switch without a branch name and it providng a list of worktree like:

1. worktree 1
2. worktree 2
3. worktree 3

4. worktree 4

(note the grouping into groups of three separated by a blank line)

and then asking which worktree I want to switch to. if I enter 4, it will go there.

This would allow me to save the time of remembering or typing in the branch name.

eric-g-97477 avatar Mar 30 '26 12:03 eric-g-97477

Thanks for the suggestion! Running wt switch without a branch name already opens an interactive picker that lets you browse and select worktrees — it includes a live preview panel showing diffs and status. You can navigate with arrow keys or j/k, type to filter, and press Enter to switch.

The picker is a full TUI rather than a numbered list, but it solves the same problem of not needing to remember or type branch names. Give it a try and see if it covers your use case!

The numbered-index approach (where wt list shows numbers and wt switch 2 jumps to that index) is tracked separately in #966 — that's still open if you'd prefer that style of interaction.

A maintainer can evaluate whether this can be closed as covered by the existing picker, or whether it should stay open as a variant of #966.

worktrunk-bot avatar Mar 30 '26 12:03 worktrunk-bot