Claude Code 推出 NO_FLICKER 模式,優化終端機渲染體驗
AI 語音朗讀 · Edge TTS
Claude Code 推出 NO_FLICKER 模式,優化終端機渲染體驗。
Claude Code 引入了名為「NO_FLICKER」的實驗性全螢幕渲染模式,透過虛擬化視窗技術解決終端機渲染瓶頸,提供更流暢且記憶佔用穩定的互動體驗。
核心技術優勢
- 消除渲染閃爍:透過虛擬化整個視窗,解決了終端機在輸出大量資料時常見的閃爍與畫面跳動問題。
- 記憶管理:僅渲染目前可見的訊息,確保在長對話中記憶與 CPU 使用率保持恆定。
- 滑鼠支援:使用者可透過點擊進行游標定位、展開工具結果、開啟連結,以及選取文字。
運作機制與權衡
此模式採用類似 vim 或 htop 的機制,將介面繪製於終端機的「替代螢幕緩衝區」(alternate screen buffer),這帶來了顯著的改進,但也伴隨了不可忽視的權衡:
- 搜尋功能變更:原生的
cmd-f搜尋失效,需使用ctrl+o進入「轉錄模式」(transcript mode) 進行搜尋。 - 複製貼上限制:原生的複製貼上功能無法直接運作,系統會自動將選取內容複製到剪貼簿,或需透過特定快捷鍵處理。
- 滑鼠捕捉衝突:啟用滑鼠捕捉後,終端機原生的選取功能會失效,需依賴 Claude Code 內部的選取機制。
配置與相容性
作為一項研究預覽功能,使用者需透過環境變數啟用,並注意特定環境下的相容性:
- 啟用方式:設定環境變數
CLAUDE_CODE_NO_FLICKER=1即可啟用。 - tmux 相容性:在
tmux中使用需確保開啟滑鼠模式 (set -g mouse on),且不支援tmux -CC(iTerm2 整合模式)。 - 靈活配置:若需保留原生選取功能,可同時設定
CLAUDE_CODE_DISABLE_MOUSE=1以關閉滑鼠捕捉,僅保留渲染優化。
Today we're excited to announce NO_FLICKER mode for Claude Code in the terminal
— Boris Cherny (@bcherny) April 1, 2026
It uses an experimental new renderer that we're excited about. The renderer is early and has tradeoffs, but already we've found that most internal users prefer it over the old renderer. It also… https://t.co/taFud8twm9 pic.twitter.com/L6d16HHBg5
Some of the upsides:
— Boris Cherny (@bcherny) April 1, 2026
- No more flickering
- No more jumping
- Constant memory and CPU usage as the conversation grows
- Mouse support! You can now click to move your cursor within the input box. Some other UI elements are also clickable now.
- Nicer selection behavior. eg. when…
There's also downsides:
— Boris Cherny (@bcherny) April 1, 2026
- Native cmd-f doesn't work. Instead, hit ctrl+o then / to search the transcript (or, use ctrl-r for reverse search)
- Native copy-paste doesn't work. Instead, we copy to the clipboard by default when you make a selection. You can configure this in your…
There's a lot of tradeoffs when building for the terminal. Unlike web, mobile, and desktop, terminal have fairly restrictive instruction sets for rendering: ANSI escape codes.
— Boris Cherny (@bcherny) April 1, 2026
There's an ANSI code for "move cursor to (x, y)", another for "write 'foo'", etc. It feels a little…
Our new experimental NO_FLICKER renderer solves this by virtualizing the entire viewport.
— Boris Cherny (@bcherny) April 1, 2026
We hook into keyboard and mouse events to make scrolling work, and we virtualize the viewport to move control over what is rendered into the application layer.
This approach has tradeoffs,…
Let us know what you think! We're actively iterating on this new mode, and can't wait to hear your feedback.https://t.co/rWPTv9Ki11
— Boris Cherny (@bcherny) April 1, 2026
