xterm.js
xterm.js copied to clipboard
Handle general canvas context loss
Contexts can become lost when graphics card drivers are reinstalled for example. This should be handled generically.
VS Code issue: https://github.com/microsoft/vscode/issues/94513
Related: https://github.com/xtermjs/xterm.js/issues/2253
I believe this is handled now for webgl with https://github.com/xtermjs/xterm.js/pull/3276
@Tyriar Is that issue also behind those funky outputs after a machine wakeup from sleep mode for the canvas renderer? If so, is there a way to detect it programmatically like webglcontextlost for webgl? Because then we would need to invalidate all those shiny _ctx flying around in our renderer code and "reboot" them (prolly including the caches).
@jerch we can't detect that happening on the web, the GPU's texture gets corrupted but AFAICT there's no way for us to listen for it. The fix there in VS Code was to listen via electron to OS resume and clear all texture atlases using the webgl API and the new xterm core API for clearing the canvas texture atlas.
Hmm ic, well its a pity but not much we can do about it.