Skip to content

Allow filtering worktrees by branch name in Worktrees pane #5945

Description

@phanirithvij

Is your feature request related to a problem? Please describe.

I would like to filter the worktrees in the Worktrees pane by not just the worktree name but the branch name.

Describe the solution you'd like

When I search for text using "/" key in Worktrees pane, a branch which matches the search term should show in the results.

Describe alternatives you've considered

Nothing

Additional context

As PRs are not allowed, here is a patch which can be included to the tree with git am if you find it useful.

commit a4afe26ba2cab14535522519ce48b31e00cb1438
Author: phanirithvij <phanirithvij2000@gmail.com>
Date:   Tue Aug 18 10:42:45 2026 +0530

    Allow filtering worktrees by branch name in Worktrees pane

diff --git a/pkg/gui/context/worktrees_context.go b/pkg/gui/context/worktrees_context.go
index 3e45f2d45..690fa6d4b 100644
--- a/pkg/gui/context/worktrees_context.go
+++ b/pkg/gui/context/worktrees_context.go
@@ -16,8 +16,8 @@ var _ types.IListContext = (*WorktreesContext)(nil)
 func NewWorktreesContext(c *ContextCommon) *WorktreesContext {
 	viewModel := NewFilteredListViewModel(
 		func() []*models.Worktree { return c.Model().Worktrees },
-		func(Worktree *models.Worktree) []string {
-			return []string{Worktree.Name}
+		func(worktree *models.Worktree) []string {
+			return []string{worktree.Name, worktree.Branch}
 		},
 	)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions