Skip to content

wt list: Show index numbers and support wt switch <number> #966

@Pager07

Description

@Pager07

Branch names can be long and tedious to type when switching between worktrees. It would be helpful if wt list displayed an index column, and if wt switch accepted that index as a shortcut.

Example output from wt list:

#  Branch       Status  ...
1  feature-a       ⚑^   ...
2  feature-b       ✗|   ...
3  bugfix-c     !  ✗⇡   ...

Then running:

wt switch 2

would switch to feature-b.

If the argument passed to wt switch is a number that matches an index, it should be treated as an index. Otherwise, it should be treated as a branch name to preserve backwards compatibility.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions