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

Be more defensive to prevent issues when resize and writes overlap #661

Closed
Tyriar opened this issue May 12, 2017 · 8 comments
Closed

Be more defensive to prevent issues when resize and writes overlap #661

Tyriar opened this issue May 12, 2017 · 8 comments
Assignees
Labels
type/bug Something is misbehaving

Comments

@Tyriar
Copy link
Member

Tyriar commented May 12, 2017

#164 (comment)

@Tyriar Tyriar self-assigned this May 12, 2017
@Tyriar Tyriar added the type/bug Something is misbehaving label May 12, 2017
@Tyriar Tyriar added this to the 2.7.0 milestone May 12, 2017
@tht13
Copy link

tht13 commented May 12, 2017

Use of the fit addon seemed to solve my issue, I couldn't quite figure out why that is able to perform the resize correctly though.

@Tyriar Tyriar modified the milestones: 2.7.0, 2.8.0 Jun 5, 2017
@Tyriar Tyriar removed this from the 2.8.0 milestone Jul 3, 2017
@ghost
Copy link

ghost commented Aug 7, 2017

I updated to xterm 2.9.1 today and now get this error when opening new terminals. I created the terminal and then attach a resize handler to resize the terminal using the 'fit' addon. I noticed this error happens whenever the initial number of rows when the terminal starts is later increased by the resize handler. I worked around this by setting something like 200 rows when creating the terminal.

The specific line that triggered this error for me is at https://github.com/sourcelair/xterm.js/blob/5bc0ad879b7b9cdc3c8617478512ba80affc5d79/src/Renderer.ts#L170

@infnada
Copy link

infnada commented Aug 10, 2017

Uncaught TypeError: Cannot read property '0' of undefined at Renderer._refresh (xterm.js:2333) at Renderer._refreshLoop (xterm.js:2295)

var data = line[i][0];

Same error here. But if at the start of the ssh session I type ls on a folder with lots of files (like /etc), then I can make a .fit() at any time without problems.

@shortwavedave
Copy link

I was also seeing this problem. The height parameter of the class was set to a relative value, like 40%. When I added a min-height with a specific pixel value, the error went away.

 .terminal {
              background-color: #111;
              bottom: 10px;
              color: #fafafa;
              width: 100%;
              height: 40%;
              min-height: 400px;
              margin: 0 auto;
              padding: 10px;
          }

@amejia1
Copy link
Contributor

amejia1 commented Sep 10, 2017

Hello again. By the way, I'm that ghost above. Just decided to merge my account to the one I'm using now.

Anyway, I've been researching this issue and trying to fix it in my Atom plugin. I've pinpointed it down to a problem involving the less program, at least with my plugin. More on that is here (https://github.com/amejia1/atom-xterm/issues/4). So far, I've just been working around the problem but I think the problem I'm facing could be due to either node-pty or xterm.js.

@Tyriar
Copy link
Member Author

Tyriar commented Sep 11, 2017

@amejia1 have you tried reproducing it on the v3 branch?

@amejia1
Copy link
Contributor

amejia1 commented Sep 12, 2017

I had since made changes to the atom-xterm plugin. This issue now only appears whenever I use the 'less' program when I resize the terminal from larger to smaller. I reported this at #977 . I'll try the v3 branch.

@Tyriar
Copy link
Member Author

Tyriar commented Jun 2, 2018

I'm closing this off to keep out issue count lower as it hasn't gained any traction, is stale or is not worth tracking.

@Tyriar Tyriar closed this as completed Jun 2, 2018
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

5 participants