worktrunk icon indicating copy to clipboard operation
worktrunk copied to clipboard

[Bug] Narrow terminal width wt switch selector doesn't show worktree names

Open armstrjare opened this issue 8 months ago • 1 comments

When in a narrow terminal (i.e. on a phone), the wt switch command with the selection TUI tries to show a 2-column layout and tends to hide the worktree names due to lack of space. This makes it practically impossible to determine which item in the list is the worktree that you want to switch to.

Suggestion: only show branch name list in a single column in narrow terminals

armstrjare avatar Mar 16 '26 12:03 armstrjare

Thanks for reporting this! I was able to reproduce the issue and identified the root cause: PreviewLayout::auto_detect() only considers aspect ratio when choosing between side-by-side (Right) and stacked (Down) layout, so narrow terminals with a landscape ratio (e.g. 60×24 on a phone) still get the Right layout — leaving only 30 columns for the branch list.

I've opened #1564 with a fix that adds a minimum width check (80 columns) so narrow terminals always use Down layout, giving branch names the full terminal width. A maintainer will review it shortly.

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