Source: external review report, 2026-08-24 (severity: Medium)
Problem
src/clip.sh:55 — shellframe_str_len() is ${#1} (code points, not columns). Every aligned surface — panel borders, table columns, grid, diff side-by-side, form fields — misaligns on CJK/emoji (width 2) and over-counts combining sequences (width 0).
Defensible as an ASCII-scoped limitation, but the docs don't state it, and "VT100-compatible" implies more than it delivers.
Options
A. Document the limitation (XS) — README + docs/api.md: "Layout assumes single-column characters. Wide (CJK/emoji) and combining characters will misalign borders." Ship this regardless.
B. wcwidth approximation (M) — shellframe_str_width() using a small range table (CJK Unified, Hangul, fullwidth forms, common emoji blocks → 2; combining marks → 0). Pure bash, no external tools. Swap call sites in clip/panel/table/grid/diff. Must stay fast enough on 3.2 — benchmark before adopting.
Recommend A immediately, B as a Phase 7 enhancement.
Tests
- Unit:
shellframe_str_width '日本' → 4; combining é (e + U+0301) → 1
- ptyunit: table with a CJK cell renders aligned borders
Effort: XS (A) / M (B)
Deps: none. Related: #54 (wide-char strategy).
Source: external review report, 2026-08-24 (severity: Medium)
Problem
src/clip.sh:55—shellframe_str_len()is${#1}(code points, not columns). Every aligned surface — panel borders, table columns, grid, diff side-by-side, form fields — misaligns on CJK/emoji (width 2) and over-counts combining sequences (width 0).Defensible as an ASCII-scoped limitation, but the docs don't state it, and "VT100-compatible" implies more than it delivers.
Options
A. Document the limitation (XS) — README +
docs/api.md: "Layout assumes single-column characters. Wide (CJK/emoji) and combining characters will misalign borders." Ship this regardless.B. wcwidth approximation (M) —
shellframe_str_width()using a small range table (CJK Unified, Hangul, fullwidth forms, common emoji blocks → 2; combining marks → 0). Pure bash, no external tools. Swap call sites in clip/panel/table/grid/diff. Must stay fast enough on 3.2 — benchmark before adopting.Recommend A immediately, B as a Phase 7 enhancement.
Tests
shellframe_str_width '日本'→ 4; combiningé(e + U+0301) → 1Effort: XS (A) / M (B)
Deps: none. Related: #54 (wide-char strategy).