nanocoder icon indicating copy to clipboard operation
nanocoder copied to clipboard

[Bug] A non-ASCII git branch name breaks the welcome screen's location line

Open addyCooks opened this issue 2 months ago • 1 comments

Description

welcome-message.tsx budgets the ⎇ branch · cwd location line using plain .length, not display width. Any branch name containing CJK characters or emoji gets undercounted (a wide glyph is 1 in .length but 2 display columns), so the line's width budget is wrong and it breaks into two rows with a dangling separator.

Parent: #907

Steps to Reproduce

  1. In a git repo, check out a branch with a CJK or emoji-containing name (e.g. 🚀-功能-branch-名前-x).
  2. Start Nanocoder at a moderate terminal width (~50 columns).
  3. Look at the welcome screen's location line.

Expected Behavior

The ⎇ branch · cwd line truncates gracefully if too long, same as it does for plain-ASCII branch names.

Actual Behavior

The line breaks into two orphaned rows: the branch name followed by a dangling · separator with nothing after it, then the cwd stranded alone on the next line.

Recording

Image

Root Cause

source/components/welcome-message.tsx:92-104 budgets with String.length instead of a display-width-aware measurement, undercounting every wide glyph in the branch name.

Suggested Fix

Budget with a display-width-aware measurement (e.g. string-width) instead of raw .length.

Additional Context

  • [x] I have searched existing issues to ensure this is not a duplicate
  • [x] I can reproduce this issue consistently
  • [x] This issue occurs on the latest main

addyCooks avatar Sep 18 '26 18:09 addyCooks

Hey @akramcodez,
I’d be happy to take this one up. could you assign this to me ?

addyCooks avatar Sep 18 '26 18:09 addyCooks