Renderer crash when resizing terminal with text-wrap
See original GitHub issueDetails
- Browser and browser version: Chrome 71.0.3578.98, Safari 12.0.2 (14606.3.4), Firefox 65.0
- OS version: Windows 10 & macOS Mojave
- xterm.js version: v3.11.0
Steps to reproduce
- Visit: https://4jnl8qxxn4.codesandbox.io/
- Open browser dev console
- Click “Play Example” button
- Observe
TextRenderLayer
crash
Error trace copied below:
Uncaught TypeError: Cannot read property 'get' of undefined
at TextRenderLayer._forEachCell (TextRenderLayer.js:51)
at TextRenderLayer._drawBackground (TextRenderLayer.js:101)
at TextRenderLayer.onGridChanged (TextRenderLayer.js:164)
at eval (Renderer.js:166)
at Array.forEach (<anonymous>)
at Renderer._renderRows (Renderer.js:166)
at RenderDebouncer._innerRefresh (RenderDebouncer.js:31)
at eval (RenderDebouncer.js:26)
This only started with v3.11.0, this did not happen in v3.10.1 (I’ve gone back and tested the same sample on v3.10.1).
Something of note is that this is only an issue when you have a long text gets printed to the terminal and then you resize the terminal smaller, and then resize it bigger. Another interesting behavior is that this ONLY occurs if you resize both rows AND columns, if you simply resize columns, without resizing rows, it does not crash the render (simply resizing rows also does not crash).
I would imagine it’s probably something introduced by text-wrap feature, but I’m not too sure.
Thanks in advance to anyone looking into this!
Code snippet to play with: https://codesandbox.io/s/4jnl8qxxn4
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
[vim/vim] Crash when resizing terminal with popup visible ...
Vim crashes when resizing the terminal with a popup visible. To Reproduce ... Crash seems to be reallocating the screen buffers: Expected behavior....
Read more >Fixed issues in InDesign - Adobe Support
InDesign crashes while resizing a text frame. [macOS only] InDesign crashes randomly while rendering large documents due to memory allocation ...
Read more >Releases - foot - Codeberg.org
foot - A fast, lightweight and minimalistic Wayland terminal emulator. ... Crash when resizing the window to the smallest possible size while scrollback ......
Read more >Why Windows Terminal is slow : r/programming - Reddit
So I suspect their text rendering is a hybrid where some layout happens in Windows Terminal code and some happens in DirectWrite code....
Read more >Version History - Panic - Nova
Fixed a possible crash when resizing or hiding a preview pane; Resolved a crash ... Terminal: Added an option to use GPU rendering...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Reduced repro in demo:
term.resize(40,40)
console core fd full mqueue null ptmx pts random stderr stdin stdout tty urandom zero
and press enterterm.resize(100,100)
term.resize(200,200)
This throws because lines.length === 198 (not 200)
Also running into this issue. [UPDATED] na, actually mine is a little different. But it is on resize.
I downgraded to
3.10.0
and that fixed the issue. Will revisit this issue after this bug is addressed as it might affect the issue I was facing.