Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix race condition that could when clearing atlas on 2+ terminals #4181

Merged
merged 1 commit into from
Oct 7, 2022

Conversation

Tyriar
Copy link
Member

@Tyriar Tyriar commented Oct 7, 2022

This is the proper fix for microsoft/vscode#162996, after a bunch of investigation we found that this is causing the problem:

VS Code clears the texture atlas on OS resume to fix an issue where the texture could be corrupted. This calls clearTextureAtlas twice which should be fine, but it's not because inside WebglRenderer.clear we're calling updateModel which is meant to only ever be called in an animation frame. This calls potentially both renderers to have stale views of the texture atlas for those rows and our perf caching of cells (the main purpose of the model) doesn't know it's stale.

This is the proper fix for microsoft/vscode#162996, after a bunch of
investigation we found that this is causing the problem:

VS Code clears the texture atlas on OS resume to fix an issue where the texture
could be corrupted. This calls clearTextureAtlas twice which should be fine, but
it's not because inside WebglRenderer.clear we're calling updateModel which is
meant to only ever be called in an animation frame. This calls potentially both
renderers to have stale views of the texture atlas for those rows and our perf
caching of cells (the main purpose of the model) doesn't know it's stale.

Co-Authored-By: Megan Rogge <merogge@microsoft.com>
@Tyriar Tyriar added this to the 5.1.0 milestone Oct 7, 2022
@Tyriar Tyriar requested a review from meganrogge October 7, 2022 23:17
@Tyriar Tyriar self-assigned this Oct 7, 2022
Tyriar added a commit to microsoft/vscode that referenced this pull request Oct 7, 2022
This needs xtermjs/xterm.js#4181 to be properly fixed.

Part of #162996

Co-Authored-By: Megan Rogge <merogge@microsoft.com>
@Tyriar Tyriar merged commit d948b31 into xtermjs:master Oct 7, 2022
@Tyriar Tyriar deleted the clear_race branch October 7, 2022 23:34
@ahmad-511
Copy link

I can confirm that this issue has been solved for me on git-bash, cmd and ps,
Thanks

@Tyriar
Copy link
Member Author

Tyriar commented Oct 10, 2022

@ahmad-511 thanks for confirming!

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.

3 participants