Skip to content

tui: harden inline scrollback bootstrap and scroll-region bounds (#6427) - #11221

Closed
pthrasher wants to merge 1 commit into
openai:mainfrom
pthrasher:fix-tui-scrollback-bug
Closed

pthrasher wants to merge 1 commit into
openai:mainfrom
pthrasher:fix-tui-scrollback-bug

Conversation

@pthrasher

Copy link
Copy Markdown
  • clamp the inline history scroll region to avoid emitting invalid DECSTBM ranges when the viewport is at the top row
  • validate scroll-region ranges before queuing terminal commands in the insert-history path
  • normalize inline terminal bootstrap when startup cursor y=0 by seeding viewport/cursor at the last screen row
  • add regression tests for top-row viewport insertion, invalid scroll-region ranges, and startup bootstrap fallback

Relates to: #6427 #2558 #1478 #5576

…nai#6427)

## Summary
- clamp the inline history scroll region to avoid emitting invalid DECSTBM ranges when the viewport is at the top row
- validate scroll-region ranges before queuing terminal commands in the insert-history path
- normalize inline terminal bootstrap when startup cursor y=0 by seeding viewport/cursor at the last screen row
- add regression tests for top-row viewport insertion, invalid scroll-region ranges, and startup bootstrap fallback

## Testing
- just fmt
- just fix -p codex-tui
- cargo test -p codex-tui insert_history::tests:: -- --nocapture
- cargo test -p codex-tui custom_terminal::tests::with_options_bootstraps_inline_viewport_near_bottom_when_cursor_reports_top_row -- --nocapture
- cargo test -p codex-tui

Refs openai#6427 openai#2558 openai#1478 openai#5576
@etraut-openai

Copy link
Copy Markdown
Contributor

We've updated our contribution guidelines to indicate that we're no longer accepting unsolicited code contributions. All code contributions are by invitation only. To read more about why we've taken this step, please refer to this announcement.

@glennr

glennr commented Feb 10, 2026

Copy link
Copy Markdown

We've updated our contribution guidelines to indicate that we're no longer accepting unsolicited code contributions. All code contributions are by invitation only. To read more about why we've taken this step, please refer to this announcement.

Didn't you solicit the PR here? #2558 (comment)

@basnijholt

Copy link
Copy Markdown

@etraut-openai please read #2558, this fixes a real issue that I am bothered by every single day.

@dhaern

dhaern commented Feb 10, 2026

Copy link
Copy Markdown

We've updated our contribution guidelines to indicate that we're no longer accepting unsolicited code contributions. All code contributions are by invitation only. To read more about why we've taken this step, please refer to this announcement.

@etraut-openai After you ask about being respectful and civil when you are doing things like that... you guys dont deserve it.

@joshka-oai joshka-oai self-assigned this Feb 12, 2026
@joshka-oai

Copy link
Copy Markdown
Contributor

Hey there - just a quick note on this. I'm looking at this today. This is pretty important and was closed by mistake.

@joshka-oai

Copy link
Copy Markdown
Contributor

Hey all, quick update here.

This PR addresses a real and longstanding issue, and it was closed in error. That’s on us.

Since the branch was updated after the PR was closed, GitHub won’t allow us to reopen this one. I’d like to keep the dialogue and review moving, though. @pthrasher, could you either:

  1. Open a fresh PR with the current branch state so we can review it properly, or
  2. Post a brief summary here of what changed since the original version so we can decide the cleanest path forward?

I’ll be reviewing the technical details of the fix itself (scroll-region clamping, DECSTBM bounds validation, and the bootstrap normalization when cursor y=0) and following up with concrete feedback.

Separately, I know there’s been confusion around the contribution policy versus prior discussion on related issues. We’ll clarify that process so expectations are consistent going forward. For now, let’s focus this thread on the behavior being fixed and the implementation details.

Appreciate everyone’s patience while we sort this out.

@joshka-oai

Copy link
Copy Markdown
Contributor

I spent some time playing with this PR today and digging into the changes more deeply. While there are a lot of solid ideas here, I’m still seeing rendering issues in practice. So this doesn’t fully resolve the problems we’re trying to address.

That means I’m going to keep working on this area from our side to land something that closes the loop on the behavior we’re seeing.

That said, there are genuinely good pieces in this change and in the updated fork. When we ship a fix here, I’ll make sure @pthrasher is credited appropriately for the work and ideas that influenced it.

Appreciate the effort that’s gone into this so far.

@younesbram

Copy link
Copy Markdown

thanks @joshka-oai . just to add the newest update still has this from 2/25/2026 .. copilot has htis much wrose wehn u scroll while it genereates, just make it detect that or something? idk yalls are good engineers yall got this (claude code doesnt have this :(

@basnijholt

Copy link
Copy Markdown

This issue is the only reason I am using a Codex fork (just-every/code).

@younesbram

Copy link
Copy Markdown

does that fork reliably resist these bugs? @basnijholt

@esemeniuc

Copy link
Copy Markdown

Please fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants