Repository navigation
Preserve terminal scrollback when growing the TUI viewport - #45271
Merged
copyberry[bot] merged 1 commit intoSep 13, 2026
Conversation
## Why Scrolling with `CSI S` can discard history rows in QTermWidget and xterm.js when the viewport grows. ## What changed Use newlines at the bottom of the history scroll region for `ScrollbackStrategy::Standard`, preserving the composer and restoring the cursor and full-screen scroll region afterward. Fall back to full-screen scrolling when only one history row exists, since `DECSTBM` requires two distinct rows. Skip scrolling when there are no history rows or no rows to scroll. ## Testing Add regression tests for composer and cursor preservation, scroll-region restoration, emitted newline sequences, single-row scrollback preservation, and no-op growth. Snapshot visible geometry for growth by one, three, and four rows. GitOrigin-RevId: 1dbfc30bb6997dcc2738ec6b2f42d35c786124de
copyberry
Bot
force-pushed
the
copyberry/codex-internal-to-codex-oss/1dbfc30bb6997dcc2738ec6b2f42d35c786124de
branch
from
September 13, 2026 18:15
1ffb7cf to
44b9011
Compare
copyberry
Bot
deleted the
copyberry/codex-internal-to-codex-oss/1dbfc30bb6997dcc2738ec6b2f42d35c786124de
branch
September 13, 2026 18:15
tscherrie
temporarily deployed
to
issue-triage
September 13, 2026 18:29 — with
GitHub Actions
Inactive
tscherrie
temporarily deployed
to
issue-triage
September 13, 2026 18:29 — with
GitHub Actions
Inactive
tscherrie
temporarily deployed
to
issue-triage
September 13, 2026 18:29 — with
GitHub Actions
Inactive
tscherrie
temporarily deployed
to
issue-triage
September 13, 2026 18:30 — with
GitHub Actions
Inactive
aidawilliam41-ops
temporarily deployed
to
issue-triage
September 13, 2026 18:32 — with
GitHub Actions
Inactive
aidawilliam41-ops
temporarily deployed
to
issue-triage
September 13, 2026 18:32 — with
GitHub Actions
Inactive
aidawilliam41-ops
temporarily deployed
to
issue-triage
September 13, 2026 18:32 — with
GitHub Actions
Inactive
aidawilliam41-ops
temporarily deployed
to
issue-triage
September 13, 2026 18:32 — with
GitHub Actions
Inactive
aidawilliam41-ops
temporarily deployed
to
issue-triage
September 13, 2026 18:32 — with
GitHub Actions
Inactive
aidawilliam41-ops
temporarily deployed
to
issue-triage
September 13, 2026 18:32 — with
GitHub Actions
Inactive
aidawilliam41-ops
temporarily deployed
to
issue-triage
September 13, 2026 18:33 — with
GitHub Actions
Inactive
aidawilliam41-ops
temporarily deployed
to
issue-triage
September 13, 2026 18:33 — with
GitHub Actions
Inactive
MaddMind
temporarily deployed
to
issue-triage
September 13, 2026 18:47 — with
GitHub Actions
Inactive
MaddMind
temporarily deployed
to
issue-triage
September 13, 2026 18:47 — with
GitHub Actions
Inactive
MaddMind
temporarily deployed
to
issue-triage
September 13, 2026 18:47 — with
GitHub Actions
Inactive
MaddMind
temporarily deployed
to
issue-triage
September 13, 2026 18:48 — with
GitHub Actions
Inactive
This branch was previously deployed
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Preserve terminal scrollback when growing the TUI viewport
Why
Scrolling with
CSI Scan discard history rows in QTermWidget and xterm.js when the viewport grows.What changed
Use newlines at the bottom of the history scroll region for
ScrollbackStrategy::Standard, preserving the composer and restoring the cursor and full-screen scroll region afterward. Fall back to full-screen scrolling when only one history row exists, sinceDECSTBMrequires two distinct rows. Skip scrolling when there are no history rows or no rows to scroll.Testing
Add regression tests for composer and cursor preservation, scroll-region restoration, emitted newline sequences, single-row scrollback preservation, and no-op growth. Snapshot visible geometry for growth by one, three, and four rows.