Fix chat terminal flicker during streaming#298598
Merged
meganrogge merged 1 commit intomicrosoft:mainfrom Mar 2, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes embedded chat terminal flicker during command output streaming by ensuring full terminal reset + rewrite happens atomically within a single xterm write, avoiding an intermediate blank paint.
Changes:
- Replace
reset()+write(text)(two operations) with a singlewrite('\x1bc' + text)payload when a full rewrite is required. - Update the VT divergence unit test to reflect the new “single write with RIS” behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/vs/workbench/contrib/terminal/browser/chatTerminalCommandMirror.ts | Uses RIS (\x1bc) prepended to rewritten VT text to combine reset and redraw in one xterm write, preventing blank-frame flicker. |
| src/vs/workbench/contrib/terminal/test/browser/chatTerminalCommandMirror.test.ts | Adjusts the divergence test to perform the reset via RIS in the same write call, matching production behavior. |
joshspicer
approved these changes
Mar 2, 2026
DonJayamanne
pushed a commit
that referenced
this pull request
Mar 2, 2026
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.
The embedded terminal in chat flickers to blank during command execution. I used
npm run test-nodeto reproduce/test. I think the issue is inchatTerminalCommandMirror.tswhen it can't append incrementally it callsxterm.reset()thenxterm.write(text)as two separate calls and xterm renders a blank frame in between.I changed it to do
write('\x1bc' + text)instead which puts the reset and the new content in the same write call so xterm handles it all before painting.\x1bcis the same thing asreset()according to the xterm.js docs (Perform a full reset (RIS, aka '\x1bc')). I sawterminalProcessManager.tsalready does this for seamless relaunch so it seemed like a valid approach.Tested on Windows and seems to not flicker now.
Tries to fix #293128 and #293579