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

Certain escape sequences in quick succession break rendering. #2126

Closed
agronick opened this issue May 24, 2019 · 5 comments · Fixed by #2127
Closed

Certain escape sequences in quick succession break rendering. #2126

agronick opened this issue May 24, 2019 · 5 comments · Fixed by #2127
Labels
type/bug Something is misbehaving
Milestone

Comments

@agronick
Copy link

Details

  • Browser and browser version: Chrome Latest
  • OS version: Linux
  • xterm.js version: 3.13.2

Steps to reproduce

If you take the following escape sequences and run them in a fast loop nothing is rendered in the end.

      const lines = [
        '\u001b\u0063',
        '\u001b\u005d\u0030\u003b\u0020\u0007',
        '\u001b\u005b\u0048\u001b\u005b\u0032\u004a\u001b\u005b\u0031\u003b\u0033\u0033\u006d',
        'test test test',
        'lalala',
      ];
      for (let line of lines) {
        this.terminal.write(line);
      }

But if you make them run as a microtask it renders fine:

      var inter;
      inter = setInterval(
        () => (lines.length ? this.terminal.write(lines.shift()) : clearInterval(inter)),
        0
      );

The same script that contains these escape codes is run daily with thousands of users and it displays fine using an older version of xterm.js.

@jerch
Copy link
Member

jerch commented May 24, 2019

@agronick Can repro it, seems RIS wrongly recreates the write buffers as well forgetting stuff behind.

@jerch jerch added the type/bug Something is misbehaving label May 24, 2019
@agronick
Copy link
Author

Thanks for taking care of that so quick. You guys are awesome. Any idea when it will hit NPM?

@jerch
Copy link
Member

jerch commented May 24, 2019

Prolly with the next release around first week in June. Care to test if #2127 solves the issue for you? Because that code was not touched for 2 years, you either were on a really old version or its not the right fix yet. (at least works with the data you gave in the issue description)

@agronick
Copy link
Author

agronick commented May 24, 2019

I just got home for the long weekend and I won't have access until Tuesday. I'll be sure to test it then. It is possible we are on an old version.

It is also possible we have the issue in production but most servers don't output fast enough to cause the issue. Or that the users are seeing it but never reported it. Maybe they open and close the terminal until they get lucky and it works. I've never heard anyone mention it.

@Tyriar Tyriar added this to the 3.14.0 milestone May 24, 2019
@agronick
Copy link
Author

@jerch Good news! It definitely fixes it.

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

Successfully merging a pull request may close this issue.

3 participants