question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Renderer crash when resizing terminal with text-wrap

See original GitHub issue

Details

  • 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

  1. Visit: https://4jnl8qxxn4.codesandbox.io/
  2. Open browser dev console
  3. Click “Play Example” button
  4. 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:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Tyriarcommented, Feb 5, 2019

Reduced repro in demo:

  1. Run in console: term.resize(40,40)
  2. Paste console core fd full mqueue null ptmx pts random stderr stdin stdout tty urandom zero and press enter
  3. Run in console: term.resize(100,100)
  4. Run in console: term.resize(200,200)

This throws because lines.length === 198 (not 200)

1reaction
thenengahcommented, Feb 5, 2019

Also running into this issue. [UPDATED] na, actually mine is a little different. But it is on resize.

screen shot 2019-02-05 at 10 05 19 am

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found