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
fix(tui): reduce cursor jumpiness while streaming / stabilize bottom-anchored flex layout - #11064
Fixes visible cursor jank during streaming/scroll updates in the TUI.
1) Hide cursor during scrollback injection
File: codex-rs/tui/src/insert_history.rs
Change: queue Hide before we reposition/move the terminal cursor to write wrapped output into scrollback.
Why: when the cursor is visible during those intermediate MoveTo operations, users can see cursor jumping/blinking while output is streaming.
2) Make flex layout consistent for render/cursor placement
File: codex-rs/tui/src/render/renderable.rs
Change: split flex allocation into two modes:
FitContent for desired_height() (preserves intrinsic/content-based sizing)
FillAssignedExtent for render() and cursor_pos() (fills allocated flex extent, keeps fixed children anchored)
Why: previously, render/cursor layout reused content-fit allocation, which could under-fill flex space and allow fixed bottom children (composer/footer) to drift instead of staying anchored.
3) Add tests for regressions
File: codex-rs/tui/src/render/renderable.rs
Added tests:
flex_render_anchors_fixed_child_to_bottom
flex_desired_height_remains_content_based
Validation run
cargo test -p codex-tui render::renderable::tests::flex_
cargo test -p codex-tui insert_history::tests::vt100_blockquote_wrap_preserves_color_on_all_wrapped_lines
Both pass locally.
Still reproducing in codex-cli 0.120.0 on Windows 11, this time inside Zellij 0.44.1 — also tracked in #16687.
Symptoms:
Cursor jumps to the header path (working-directory line) when pressing space/backspace in the composer.
Cursor visibly follows the "Working…" spinner between frames while Codex is processing.
--no-alt-screen (the Zellij-recommended mode per codex --help) makes it less frequent but does not eliminate it; alt-screen is actually worse because of the higher redraw cadence — more intermediate MoveTo positions painted per second.
The fix in this PR (Hide before mid-frame MoveTo in insert_history.rs) matches the observed mechanism exactly. Terminal emulators that render cursor movement eagerly (Zellij's VT engine, xterm.js-based VSCode integrated terminal per #16687) paint every intermediate cursor position, while native Windows conhost hides the glitch by rendering lazily.
Could this be rebased against main? It's currently in merge conflict and hasn't had a review since 2026-03-11. Happy to test a rebased build against the Zellij + Windows 11 repro.
The reason will be displayed to describe this comment to others. Learn more.
[deleted]
This branch has not been deployed
No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
// Very low blast radius and benign problem
Linked issue
Bug report / enhancement request: #11063
Fixes visible cursor jank during streaming/scroll updates in the TUI.
1) Hide cursor during scrollback injection
codex-rs/tui/src/insert_history.rsHidebefore we reposition/move the terminal cursor to write wrapped output into scrollback.MoveTooperations, users can see cursor jumping/blinking while output is streaming.2) Make flex layout consistent for render/cursor placement
codex-rs/tui/src/render/renderable.rsFitContentfordesired_height()(preserves intrinsic/content-based sizing)FillAssignedExtentforrender()andcursor_pos()(fills allocated flex extent, keeps fixed children anchored)3) Add tests for regressions
codex-rs/tui/src/render/renderable.rsflex_render_anchors_fixed_child_to_bottomflex_desired_height_remains_content_basedValidation run
cargo test -p codex-tui render::renderable::tests::flex_cargo test -p codex-tui insert_history::tests::vt100_blockquote_wrap_preserves_color_on_all_wrapped_linesBoth pass locally.