签名闪烁 (Qiānmíng shǎnshuò)
The Signature Flicker

原始链接: https://steipete.me/posts/2025/signature-flicker

Anthropic 在 Claude Code 2.0.72 版本中解决了著名的闪烁问题,这个问题也常见于 Cursor 等许多基于终端的用户界面 (TUI)。 核心挑战在于终端并非为快速交互式更新而设计,需要仔细控制光标位置和重新渲染以避免闪烁。 Anthropic 选择采用细粒度的增量更新,从头重写渲染器,同时保留 React,而不是切换到“替代模式”,后者会完全控制终端。 替代模式虽然可以消除闪烁,但会牺牲原生终端功能,如文本选择、滚动和搜索——这些是用户强烈偏好的功能。 Gemini 和 Amp 等竞争对手最近尝试使用替代模式,但遭到了用户的强烈反对并进行了回滚。 OpenCode 和 Codex 等项目也在尝试不同的方法,Codex 目前提供最理想的类似终端的行为。 Claude Code 与 pi 一起证明,流畅的渲染 *和* 保留原生终端功能是可实现的,为编码代理树立了新标准。

黑客新闻 新的 | 过去的 | 评论 | 提问 | 展示 | 工作 | 提交 登录 签名闪烁 (steipete.me) 4 分,by tosh 2 小时前 | 隐藏 | 过去的 | 收藏 | 1 评论 spencerchubb 4 分钟前 [–] 为什么 TUI 开发者坚持做这些奇怪的事情,而不是直接制作 GUI 回复 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

tl;dr: Hell froze over. Anthropic fixed Claude Code’s signature flicker in their latest update (2.0.72)

Claude Code flickering

If there’s one thing everybody noticed about Claude Code (apart from it revolutionizing how we build software), it’s the flickering. It’s unfair to point to Anthropic since they are not alone: other TUIs such as Cursor, or really anything based on Ink have the same issue. It’s also not an easy problem at all. Claude Code uses React under the hood.1

The Issue

Terminals haven’t really been designed for interactivity. It’s possible to use ANSI escape codes to reposition the cursor and write over existing text, but that easily leads to flickering if not done well.

There are two ways to solve this:

  1. Switch to alt mode and take complete control over the terminal viewport.
  2. Carefully re-render changed parts while leaving the scrollback unchanged.

Neither option is great, and each comes with tradeoffs. Mario Zechner explains these really well in his write-up on building pi-coding-agent, so I won’t repeat the details here. I’ve spent time with option 2 myself, having ported pi-tui to Swift as TauTUI (Codex did most of the auto-translation).

For a coding agent that mostly emits text with limited interactivity, I believe carefully re-rendering only changed parts — while remaining a good terminal citizen — is the better approach.

Anthropic seems to agree. Ink, the React-based terminal renderer Claude Code originally used, didn’t support the kind of fine-grained incremental updates needed for a long-running interactive UI. This has since improved upstream, but Anthropic needed tighter control, so they rewrote the renderer from scratch — while still keeping React as the component model.

This is kind of like if a website were to do their own text rendering, highlighting, mouse movement, context menu, etc. — it would not feel like your browser. (…) We value this native experience a lot. We may explore alternate screen mode in the future, but our bar is quite high. — Thariq, Anthropic

The Landscape

Over the last year, most new coding agents have converged on alt-screen TUIs — often after fighting flicker — but the results haven’t been great. So what’s my big gripe with alt mode? It breaks features such as text selection, native scrolling or search. Of course this can be implemented in the TUI, but it won’t feel right.

Amp

Amp used Ink and shared Claude’s flickering but eventually wrote their own renderer, switching to alt mode in September.

amp find demo

  • find fails unless the text is currently on-screen
  • No native-feeling selection/context menu flow
  • Custom scrollbar; workable but not quite the terminal

Gemini

Google did a big announcement on their blog about their new alt-mode TUI, only to learn that users hate it and then rolled it back not even a week later. In the new TUI, you have to press CTRL-S to enter selection mode to copy text.

gemini text selection demo

OpenCode

OpenCode did some great engineering and built opentui in TypeScript and Zig, which renders SolidJS or React. It’s not without downsides, e.g. it doesn’t work in the standard macOS Terminal for anything below macOS 26 or GNOME’s Terminal.

opencode text demo

  • Auto-scroll near the viewport border makes small screens painful
  • No scrollbar; search doesn’t work the way you expect
  • Right click → paste into the input box doesn’t work

Codex

Compare to OpenAI’s Codex, which stays in the primary screen buffer and lets me interact with text just like I expect:

codex real demo

Codex isn’t perfect — it sometimes overwrites lines of text — but it already nails the part that matters most: it behaves like a terminal. That makes their current direction toward an alt-mode TUI feel like a regression, not an upgrade. Here’s hoping they reverse course.

pi

Mario Zechner’s pi is currently the gold-standard for differential rendering, while also using all tricks of modern terminals — including showing inline images:

pi demo

Verdict

Claude Code and pi prove you can kill flicker without giving up the terminal’s muscle memory.

Alt mode can be great for dashboards. For coding agents, though, I want the terminal’s built-ins to stay native:

  • Select text like it’s a terminal
  • Scrollback like it’s a terminal
  • Search like it’s a terminal

It’s 2025. We can have smooth rendering and keep the terminal’s superpowers.

联系我们 contact @ memedata.com