Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error after resizing both row and column at the same time. #860

Closed
benoitbzl opened this issue Aug 7, 2017 · 7 comments
Closed

Error after resizing both row and column at the same time. #860

benoitbzl opened this issue Aug 7, 2017 · 7 comments
Assignees
Labels
type/bug Something is misbehaving
Milestone

Comments

@benoitbzl
Copy link

In the case the terminal row and column are increased at the same time (calling term.resize() once), only the existing rows have their number of characters increased. The new rows are created with the previous number of columns. It seems to be a regression compared to xterm.js 2.9.0.

At the first refresh of the terminal, the error reported in the browser console is:
Uncaught TypeError: Cannot read property '0' of undefined
at Renderer.10.Renderer._refresh (Renderer.ts:170)
at Renderer.10.Renderer._refreshLoop (Renderer.ts:99)

Details

  • Browser and browser version: Chrome 59.0.3071.115
  • OS version: Windows
  • xterm.js version: 2.9.1

Steps to reproduce

  1. Create a term object with 1 row and 1 column (for example)
  2. Resize the terminal to 24 rows and 80 columns.
  3. Check the first row is resized to 80 columns (80 characters), but the second row is defined as a line with only one character (array of one element).
@parisk parisk added the type/bug Something is misbehaving label Aug 7, 2017
@parisk
Copy link
Contributor

parisk commented Aug 7, 2017

Thanks for reporting this! I was able to reproduce in the demo.

@parisk
Copy link
Contributor

parisk commented Aug 7, 2017

This will most probably make the cut for 2.9.2.

@benoitbzl
Copy link
Author

Thanks! In the meantime, I am working around the issue with two calls to term.resize() so there isn't a rush for a fix on my side.

@wlib
Copy link

wlib commented Aug 8, 2017

This appears to be the bug I have with 2.9.1. You can reproduce it quite easily by going here

@Tyriar
Copy link
Member

Tyriar commented Aug 8, 2017

Repro using demo: term.resize(100, 30)

@Tyriar
Copy link
Member

Tyriar commented Aug 8, 2017

I know why it's happening, PR coming soon.

Tyriar added a commit to Tyriar/xterm.js that referenced this issue Aug 8, 2017
This happened because buffers now resize themselves but they were
relying on Terminal to give them a blank line. The blank line was
coming back with the old columns value, causing an NPE.

Fixes xtermjs#860
@Tyriar
Copy link
Member

Tyriar commented Aug 8, 2017

Fix is out in #873 with a regression test.

@parisk once it's merged I'll pull it into v3 in another PR as there will be conflicts. Also we can do a better fix on the v3 branch like pulling blankLine into Buffer?

@Tyriar Tyriar added this to the 2.9.2 milestone Aug 8, 2017
@Tyriar Tyriar self-assigned this Aug 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something is misbehaving
Projects
None yet
Development

No branches or pull requests

4 participants