[Feature request] Add TUI to worktrunk
I think it would be great to have a wt tui that would launch a TUI for managing worktrees
example: https://github.com/chmouel/lazyworktree
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.
I'm not religiously opposed, but what is the use-case for it?
my main push is that we should spend less time managing worktrees / anything like this. are folks spending lots of time on this?
I find the agents sometimes forget about worktrees or cannot remove them because they have a submodule, so I have to keep doing
wt switch
pick the worktree
wt remove --force
which would be nice with a shortcut maybe in the switch interface or in a tui interface
@mohamed-rdr the shortcut you're describing already exists: Alt-x in the wt switch picker removes the selected worktree (or branch) in place, without leaving the picker — see the keybindings table. It's a no-op on the current worktree (the @ row), so switch away first if you're standing in the one you want gone.
The submodule part was a real bug, fixed in v0.28.0 (#1194 → #1196, then made structural in #1247). wt remove now detects initialized submodules and passes --force to git worktree remove itself — after re-verifying the worktree is clean, so it still fails closed on uncommitted work. Alt-x goes through the same removal path, so on a current version the wt remove --force step shouldn't be needed for submodules at all.
What --force still covers is a dirty worktree, and Alt-x declines that one deliberately — force-removing uncommitted work is something worktrunk requires you to ask for explicitly, so there's no force key in the picker. If the agents are leaving uncommitted changes behind, that's the case you're hitting rather than the submodule one.
If you're on ≥ v0.28 and Alt-x (or plain wt remove) still fails on a submodule worktree that's clean, that's a separate bug worth its own issue — wt --version plus the exact error would pin it down, or re-run as wt -vv remove <branch>, which prints the path of a diagnostic bundle and a ready-to-run gh gist create line right after the command output.
Sources
- Picker keybinding:
install_remove_keybinding/AltXRemoverinsrc/commands/picker/mod.rs, documented indocs/content/switch.md. - Synthesized force for submodules:
Repository::remove_worktree—use_forceis set whenhas_initialized_submodules()is true even though the caller passedforce: false, and it re-runsensure_cleanbefore the destructive command. - The picker prepares its removal with
force_worktree: false, which is what carries intoRemoveOptionsand thenremove_worktree(path, false)— so the submodule synthesis applies, but the clean gate is not skipped. - Behavior covered by
test_remove_foreground_with_submodulesandtest_remove_worktree_submodule_dirty_fails_closedintests/integration_tests/remove.rs. - Version:
git tag --contains 1383845b0(the #1196 merge) → first release is v0.28.0.