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
- Anthropic quietly ships server-side rule banning game rewrites in Claude Code — petrusenko_max · 2026-10-31
- Bootstrapping competitive edge with frontier tokens — curious_vii · 2026-10-31
- Element Forge: open-source editable AI VFX for real footage in ComfyUI — zitroffell · 2026-10-30
- Gym-Anything Adds Audit Agents That Try to Break Simulations With Legal Robot Actions — wellecks · 2026-10-30
- durable-object-migrator: zero-downtime exports for Cloudflare Durable Objects — samgoodwin89 · 2026-10-30
- This 5-question interview prompt makes Grok design your first two custom bots in minutes — nateliason · 2026-10-30