fix(terminal): defer keyword scroll refresh while Enter is pending - #2880
fix(terminal): defer keyword scroll refresh while Enter is pending#2880netcatty-bot wants to merge 2 commits into
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. |
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)