fix(terminal): defer keyword scroll refresh while Enter is pending - #2880
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 315e596e08
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| this.markVisibleRangeDirty(); | ||
| return; |
There was a problem hiding this comment.
Bound Enter-pending scroll suppression without output
When the remote PTY produces no write after Enter—for example, with echo disabled or a stalled connection—onWriteParsed never runs. enterInputPending is set by onData, but its only clear timer is armed inside onWriteParsed, so this new early return suppresses every subsequent user-scroll refresh indefinitely. Newly revealed scrollback lines therefore remain unscanned and unhighlighted until unrelated output arrives; arm a fallback timer from onData or otherwise time-bound this guard.
Useful? React with 👍 / 👎.
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Codex reported no major issues. This PR is marked ready for human review/merge. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6c4e27cb38
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // synchronously rescan the viewport and flash keywords still on screen. | ||
| // Keep real scrollback browsing synchronous; only defer the bottom-pinned | ||
| // viewport movement that can be caused by the pending Enter echo. | ||
| if (this.enterInputPending && !isBrowsingScrollback) { |
There was a problem hiding this comment.
Preserve synchronous scans when scrolling back to bottom
When a user reaches the bottom while the Enter guard is active—for example, by pressing End after first scrolling upward—viewportY === baseY makes this branch classify the user action as Enter-driven output. It marks the viewport dirty and returns without scanning it; if no write follows, the newly revealed bottom viewport is not refreshed until the 600 ms guard timer plus the debounce delay expires. Distinguish an actual output-driven viewport change from a user scroll that happens to end at the bottom so the latter retains the synchronous scroll refresh path.
Useful? React with 👍 / 👎.
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Codex reported no major issues. This PR is marked ready for human review/merge. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fbaa038b0d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| // Catch up any viewport motion deferred while Enter protection blocked | ||
| // scroll refresh (e.g. user scrolled during the post-Enter window). | ||
| this.markVisibleRangeDirty(); | ||
| this.triggerRefresh("debounced", "write"); |
There was a problem hiding this comment.
Honor bulk-output pressure before Enter catch-up
When Enter launches output that trips large-output pressure while scrollback is saturated, the pressure state intentionally remains active for two largeOutputQuietMs windows (about 960 ms), and scheduleBulkPressureCatchUp() polls until pressure.largeOutput is false before scanning. This new Enter idle timer fires at 600 ms and schedules a normal write refresh anyway; under the configured large-output debounce that can execute at about 880 ms, reintroducing keyword scans/decoration work during the protected bulk window. Please route this catch-up through the bulk-pressure path or skip scheduling while output pressure is still active.
Useful? React with 👍 / 👎.
fix(terminal): stop idle-Enter keyword highlight flash after #2880 hole
Summary
onScrollduring the Ubuntu RTT gap (beforeonWriteParsed) no longer takes the immediate user-scroll keyword path.lastRenderRange.Why
v1.1.77 claimed to fix keyword highlight flicker on Enter (#2805), but the persistence rewrite dropped the earlier
enterInputPendingscroll guard. After a normal write refresh,lastRenderRangeis null andlastWriteAtgoes stale at an idle prompt, so Ubuntu 24.04 echo that emitsonScrollbeforeonWriteParsedwas again classified as user scroll and synchronously rescanned the viewport — flashing still-visible keyword decorations.Changes
components/terminal/keywordHighlight.ts: restore Enter-time scroll deferral + idle-clear catch-up.components/terminal/keywordHighlight.test.ts: cover the idle Enter / pre-writeParsed scroll race.Testing
node --test --import tsx components/terminal/keywordHighlight.test.ts(47 passed)Fixes #2879
Automation
@codex review(own/bot PRs only)