[codex] refactor TUI to use native terminal scrollback - #161
Merged
Conversation
Probe the post-resize cursor to account for terminal line reflow, and preserve the shell cursor while resetting scroll regions on close.
lyfmt
marked this pull request as ready for review
July 17, 2026 10:39
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
The TUI previously combined the transcript, streaming output, input, overlays, and status into an alternate-screen full-frame renderer. This hid terminal-native scrollback and text selection, imposed an application-managed history window, and made resize, close, and streaming updates prone to duplicated or transient lines entering history.
Root cause
Stable transcript content and mutable terminal chrome shared the same rendering lifecycle. The renderer could not distinguish append-only history from redrawable state, while alternate-screen and mouse-tracking modes transferred scroll ownership from the terminal to the application.
Changes
User impact
Long conversations remain available in terminal-native scrollback without a 500-line application cap. Streaming updates no longer leave intermediate copies behind, resize and exit preserve committed transcript, and standard terminal or tmux scrolling and selection work without TUI-specific history controls.
Validation
mvn -pl lypi-transport-tui -am testlypi-contracts: 140 tests passedlypi-transport-tui: 400 tests passedtui frame PTY passedbefore further smoke execution was stopped at user direction.