xterm.js: TypeError: Cannot read property '_data' of undefined

While resizing the terminal smaller, the following exception occurs. It’s not clear exactly how to reproduce. I cat the content of a file and then resize the terminal to a small size:

Uncaught TypeError: Cannot read property '_data' of undefined
    at BufferLine.copyCellsFrom (xterm.js:887)
    at Buffer._reflowSmaller (xterm.js:468)
    at Buffer._reflow (xterm.js:388)
    at Buffer.resize (xterm.js:370)
    at BufferSet.resize (xterm.js:1140)
    at Terminal.resize (xterm.js:5078)
    at Terminal.resize (xterm.js:6615)
    at resize (kubebox.js:1351)
    at Item.run (kubebox.js:52341)
    at drainQueue (kubebox.js:52311)

Details

  • Browser and browser version: Chrome 69
  • OS version: Mac OS X
  • xterm.js version: 3.11.0

Steps to reproduce

  1. Resize the terminal smaller

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 18 (10 by maintainers)

Commits related to this issue

Most upvoted comments

I released 3.12.1 that includes just this fix https://github.com/xtermjs/xterm.js/releases/tag/3.12.1, beta for 3.13.0 coming soon so

I confirm #2002 fixes the issue.

We are hitting something like that in Theia as well: https://github.com/theia-ide/theia/pull/4680#issuecomment-476090542

I can reproduce it with running top -c and resizing the terminal widget.

Hi @Tyriar,

After doing more tests, we found that this bug occurs when resizing cuts off tab symbol.

e.g. Seting cols to 8 and echo a\tb, then resizing cols to 7.

– origin –

I found a way to reproduce this bug.

After cloning the repo and installing all dependencies, I run the demo page by yarn start.

bug

The following c code is the program I had executed in above gif.

#include <stdio.h>

int main() {
  int m, n;

  for (m = 1; m <= 9; ++m) {
    for (n = 1; n <= 9; ++n) {
      printf("%d * %d = %2d\t", m, n, m * n);
    }

    printf("\n=======================\n");
  }

  return 0;
}