Feature: Interactive picker for wt remove (like wt switch)
The friction
wt switch without arguments opens an interactive picker to browse and select worktrees — great UX. But wt remove has no equivalent: you must type the full branch name or be in the worktree you want to remove.
Current workaround
Switch to the target worktree first, then wt remove:
wt switch # pick worktree
wt remove # remove current
Or type the full branch name: wt remove feature/cor/ASPD-27003-add-casl-validation
Ideal solution
Two possible approaches (not mutually exclusive):
-
Interactive picker for
wt remove— same picker aswt switchbut removes the selected worktree on Enter. -
Remove keybinding in
wt switchpicker — add a shortcut (e.g.Alt-dorDel) to remove the highlighted worktree directly from the switch picker. Similar to how file managers let you delete while browsing. This might feel more natural since the picker is already the go-to for worktree navigation.
Thanks for the suggestion! This is a feature request rather than a bug, so I'll leave it for a maintainer to evaluate and prioritize.
yes, very reasonable idea!
let's add a shortcut to wt switch @worktrunk-bot ; evaluate which we should choose. it should not pass -D or -f. think about how we show success or failure
Opened #1253 with an implementation.
How it works:
alt-din the picker triggersaccept(delete), which exits skim and routes to the delete handler- Calls
handle_removewith safe defaults — no-D(force-delete unmerged branches), no-f(force-remove dirty worktrees) - On success: prints the standard
wt removeoutput (worktree removed, branch deleted) and exits - On failure: shows the error (e.g., "has uncommitted changes", "cannot remove main working tree") and exits non-zero
- Controls line in the preview pane updated to show
alt-d: delete
Design choice on success/failure UX: After the picker exits, we show the same output as wt remove — this keeps it familiar and gives the user clear feedback. If the user wants to delete more worktrees, they can re-run wt switch. Keeping the picker open after a delete would require re-launching skim, which would cause screen flicker and add complexity.
codecov/patch: The delete handler code runs inside skim's accept flow, which requires interactive PTY input to trigger. The existing PTY test infrastructure could support an alt-d test, but the removal would require a non-current worktree to exist in the test repo — happy to add that if you'd like, but wanted to keep the initial PR focused.
This either isn't working right or has drifted. On Mac wt v0.81.0, the command appears to be alt-x when in the wt switch picker. When you execute it, there is almost no feedback in the TUI - i think the / in the left column means it's been removed? I can't tell. Then pressing Enter on the same row re-creates the same worktree.
There is feedback if there are conflicts or a reason it can't do it, but the happy-path feedback feels incomplete to me. I would prefer at least an output "removed worktree xyz". Am I missing something?
Regardless, I am a huge fan of this utility, and tell all my peers about it, and they love it too!
Yes: / marks a branch with no worktree. In the current picker, Alt-x can remove the worktree while keeping its unmerged branch, changing that row to / branch. Enter on the branch row creates a worktree again. The removal runs silently inside the picker, so the row change is the only success feedback; #4636 tracks making that result clear. Your separate request for a picker opened by wt remove is in #4635.