Description
The wt list output columns become misaligned when worktree names or branch names exceed the fixed column widths.
Example
📁 my_project
└─ ~/Developer/work/my_project
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▶ main main e6e738f my_project
• feishu-notification feature/feishu-notification e6e738f my_project.feishu-notification
Root Cause
In bin/messages.sh, the list_global_worktree_entry message uses fixed-width printf format:
printf ' %s %-13s %-18s %-8s %s' "$marker" "$name" "$branch" "$hash" "$path"
- Column 2 (name):
%-13s - but "feishu-notification" is 18 chars
- Column 3 (branch):
%-18s - but "feature/feishu-notification" is 27 chars
Affected Lines
bin/messages.sh:647 (English)
bin/messages.sh:1488 (Chinese)
Possible Solutions
- Increase fixed widths - Simple but may still break with very long names
- Dynamic column sizing - Calculate max width per column before printing
- Truncate with ellipsis - Keep fixed width but truncate long values
Description
The
wt listoutput columns become misaligned when worktree names or branch names exceed the fixed column widths.Example
Root Cause
In
bin/messages.sh, thelist_global_worktree_entrymessage uses fixed-width printf format:%-13s- but "feishu-notification" is 18 chars%-18s- but "feature/feishu-notification" is 27 charsAffected Lines
bin/messages.sh:647(English)bin/messages.sh:1488(Chinese)Possible Solutions