You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Codex CLI pet flickers on animation frame changes inside tmux in Ghostty #63705
CLIIssues related to the Codex CLITUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displaybugSomething isn't workingpets
The pet appears in /pets and animates, but visibly flickers when the image changes. The same pet animates smoothly when I run Codex directly in Ghostty. I need to keep using tmux.
Environment
macOS
Codex CLI 0.171.0
Ghostty 1.4.0
tmux 3.8
Steps to reproduce
Open a fresh Ghostty tab and start an isolated tmux server with no user config: tmux -L pet-test -f /dev/null new-session
Inside that session, run tmux set -g allow-passthrough all.
Launch Codex with codex -c tui.fullscreen_transcript=true -c 'tui.alternate_screen="always"'.
Open /pets, select a pet, and watch several animation frames.
Expected: The pet animates smoothly, as it does directly in Ghostty.
Actual: The pet flickers on frame changes. This reproduces both in my regular tmux session and in the isolated session above.
Additional context
My regular tmux client reports the sync terminal feature. Static images display successfully through tmux with Chafa. I haven’t isolated which component causes the animation flicker.
I captured the outer PTY byte stream from tmux 3.8 with a two-frame probe modeled on the 0.171.0 pet renderer. The delete and replacement upload both reached the client outside synchronized output, even though the pane application wrapped the entire frame in DEC mode 2026. I saw the same ordering on two runs.
The probe used a fresh tmux server, an attached PTY client with TERM=xterm-256color, terminal-features including sync:RGB, and allow-passthrough all. For each frame it sent a Kitty delete-by-ID and a virtual-placement PNG upload for the same ID via tmux passthrough, then wrote one Unicode placeholder through the pane. On the second frame the outer stream contained these events in order:
That gives the terminal a window in which the old image has been removed before the replacement is available. The capture establishes the ordering. Whether Ghostty actually presents a blank frame in that window still needs a visual check. A focused A/B would upload the next frame under a second ID while the first remains visible, switch the placeholder to the new ID, and retire the old image after the switch reaches the client.
Root cause (verified against code at HEAD 5a2cb73):
render_pet_image() in codex-rs/tui/src/pets/mod.rs deletes the previous Kitty image id and then transmits the new frame under the SAME id — a delete-before-upload sequence. Commenter r266-tech's outer-PTY probe on tmux 3.8 shows both the delete and the replacement upload landing outside DEC 2026 synchronized output, so the old image is removed before the replacement is available, which is the flicker window.
Proposed fix: double-buffer the Kitty image id — upload each new frame under a fresh/alternate id, switch the placeholder to the new id, and only then delete the old id. The change should be localized to render_pet_image + PetImageRenderState.
Note: there is no Rust toolchain on this VM, so I cannot build/test the fix here, and the blank-frame visual check is still pending.
CLIIssues related to the Codex CLITUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displaybugSomething isn't workingpets
Activity
r266-tech commentedon Nov 24, 2026
I captured the outer PTY byte stream from tmux 3.8 with a two-frame probe modeled on the 0.171.0 pet renderer. The delete and replacement upload both reached the client outside synchronized output, even though the pane application wrapped the entire frame in DEC mode 2026. I saw the same ordering on two runs.
The probe used a fresh tmux server, an attached PTY client with
TERM=xterm-256color,terminal-featuresincludingsync:RGB, andallow-passthrough all. For each frame it sent a Kitty delete-by-ID and a virtual-placement PNG upload for the same ID via tmux passthrough, then wrote one Unicode placeholder through the pane. On the second frame the outer stream contained these events in order:That gives the terminal a window in which the old image has been removed before the replacement is available. The capture establishes the ordering. Whether Ghostty actually presents a blank frame in that window still needs a visual check. A focused A/B would upload the next frame under a second ID while the first remains visible, switch the placeholder to the new ID, and retire the old image after the switch reaches the client.
Both the picker and ambient pet share this delete-before-upload path. 0.171.0 renderer · Virtual placement and placeholder writes
akhil9tiet commentedon Nov 24, 2026
I'm interested in working on this — please assign it to me.
akhil9tiet commentedon Nov 24, 2026
Root cause (verified against code at HEAD 5a2cb73):
render_pet_image()incodex-rs/tui/src/pets/mod.rsdeletes the previous Kitty image id and then transmits the new frame under the SAME id — a delete-before-upload sequence. Commenter r266-tech's outer-PTY probe on tmux 3.8 shows both the delete and the replacement upload landing outside DEC 2026 synchronized output, so the old image is removed before the replacement is available, which is the flicker window.Proposed fix: double-buffer the Kitty image id — upload each new frame under a fresh/alternate id, switch the placeholder to the new id, and only then delete the old id. The change should be localized to
render_pet_image+PetImageRenderState.Note: there is no Rust toolchain on this VM, so I cannot build/test the fix here, and the blank-frame visual check is still pending.