VS Code issue: https://github.com/microsoft/vscode/issues/90903

@Tyriar I would like to take this. Can you give a pointer as to where I should start tackling this? I understand that the sections of the canvas must be redrawn.
Sounds good!
onResize in WebGL: https://github.com/xtermjs/xterm.js/blob/cdcbb1d6daa2b972de9ccb510e67f80ec8904319/addons/xterm-addon-webgl/src/WebglRenderer.ts#L133
onResize in DOM: https://github.com/xtermjs/xterm.js/blob/cdcbb1d6daa2b972de9ccb510e67f80ec8904319/src/browser/renderer/dom/DomRenderer.ts#L259-L262
This is how the dom selection gets cleared, we should look at related parts and clear during resize in a similar way as the webgl renderer:
@Tyriar My findings so far:
onRezise with WebGL rendered selection elements are not reset. However, selection model is reset.
I made changes so that selection elements are reset on resize and drawn back as in the case of canvas rendererType.
As this is a vscode related issue is there any document I can follow to test by integrating these changes with vscode?
Let me know if any other changes are required.
@rishab-pdx I think it's an xterm.js issue, if needed for testing you can access term in the devtools console in the xterm demo.
If you want to test inside VS Code you would set up your environment so you can launch "Code - OSS" and then do this:
cd node_modules
rm -rf xterm
git clone https://github.com/rishab-pdx/xterm.js xterm
cd xterm
yarn
yarn package # call this whenever you make changes
Not very smooth as I rarely do this, you can use symlinks too to make it nicer.
I can take a further look at this issue, as it is directly related to microsoft/vscode#90903.
@tabaddor fyi there's a mostly done PR for this so I'd hold off unless @rishab-pdx says he's too busy to tackle it in the near future https://github.com/xtermjs/xterm.js/pull/2889
@tabaddor you can have a crack at it. I might not be able to take it in the near future.
Why can't we simply just remove all selections for WebGL, as we do for the DOM renderer? Or is that essentially what @rishab-pdx accomplished?
@tabaddor we could, but I think the ideal behavior here is to retain/amend the selection given the new dimensions, see https://github.com/xtermjs/xterm.js/pull/2889#issuecomment-621866500