mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-19 05:02:41 +00:00
fix(tui): stabilize regional indicator width to prevent streaming render drift (#1783)
This commit is contained in:
parent
d4084a7ad6
commit
85d06052fb
4 changed files with 68 additions and 0 deletions
|
|
@ -60,6 +60,13 @@ function graphemeWidth(segment: string): number {
|
|||
return 0;
|
||||
}
|
||||
|
||||
// Regional indicator symbols (U+1F1E6..U+1F1FF) are often rendered as
|
||||
// full-width emoji in terminals, even when isolated during streaming.
|
||||
// Keep width conservative (2) to avoid terminal auto-wrap drift artifacts.
|
||||
if (cp >= 0x1f1e6 && cp <= 0x1f1ff) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
let width = eastAsianWidth(cp);
|
||||
|
||||
// Trailing halfwidth/fullwidth forms
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue