Gemini CLI fix: ExpandableText truncation no longer splits emoji surrogate pairs
Grove-ovo · ghdev · 2026-09-13
Grove-ovo 向 gemini-cli 提交 PR #29303,修复 ExpandableText 组件用 UTF-16 code-unit 索引截断文本时的 bug:当截断边界落在 emoji 的高代理项上时,Ink 收到未配对代理并静默丢字符,如 aaaa😀tail 在 maxWidth 5 下渲染成 aaaa...。修复方案:所有截断路径改用 code points 度量与切片,复用 textUtils.ts 的 cpLen/cpSlice,并在 UTF-16 偏移与码点索引间转换;调用点 SuggestionsDisplay 和 InputPrompt 同步改用 cpLen,边界条件从 >= 改为 >,避免恰好等宽的标签出现无意义的展开箭头。纯 ASCII 标签走快速路径,输出字节级不变。作者另指出两个遗留同类问题已单独开 issue。
More from coding & agent
- Building a sleeping interactive character on Waveshare ESP32 with Copilot CLI — DanWahlin · 2026-09-13
- From GitHub profile generator to AI agent platform: $1.2k MRR, 7M browser frames, and why it dropped coding agents — False_Mountain_7289 · 2026-09-13
- Creator says Claude Code + GPT-6 astra now edits video better than he does — AlchainHust · 2026-09-13
- Non-coder Huashu hits 10k GitHub followers, open-source skills near 60k stars — AlchainHust · 2026-09-13
- Claude Code tips: /goal sets finish lines, /loop polls changing inputs like CI — addyosmani · 2026-09-13
- Dev jokes: nobody can bill two weeks for a CRUD API in the AI era — tlakomy · 2026-09-13