jerch / xterm-addon-image

Image addon for xterm.js
MIT License
51 stars 6 forks source link

Positioning breaks #53

Closed Tyriar closed 1 year ago

Tyriar commented 1 year ago

This issue with the scroll bar happens due to the image canvas https://github.com/microsoft/vscode/issues/184894

image

No errors in console, it just happens sometimes. I notice the canvas isn't getting resized with the others:

Recording 2023-06-26 at 13 04 19

jerch commented 1 year ago

Hmm, seems to be a too eager optimization exiting the render method too early, this call needs to be before all the early exit clauses: https://github.com/jerch/xterm-addon-image/blob/f2299bda4f8ed3eefffe15fd913e928e8b05b0cd/src/ImageStorage.ts#L357

Or is there a better method from within a renderer? (I remember having issues to spot metrics changes properly...)

jerch commented 1 year ago

The change in #54 should fix it, gonna do a patch release so you test it.

Also about canvas resizes - found the issue I had before with it. onResize gets called before the output system has adjusted the metrics, thus I could not use that event for canvas adjustments (I only use it for terminal buffer adjustments). Instead the render method does it on the fly if needed, but skipped it wrongly before, if there was no image data to draw at all.

Tyriar commented 1 year ago

Thanks for the quick fix!