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.

Certain escape sequences in quick succession break rendering.

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
agronickcommented, May 28, 2019

@jerch Good news! It definitely fixes it.

0reactions
agronickcommented, 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Escape Sequences | Microsoft Learn
Escape sequences are typically used to specify actions such as carriage returns and tab movements on terminals and printers. They are also used ......
Read more >
Using character escapes in markup and CSS - W3C
Character escapes are a way of writing a character in markup using only ASCII code points. They are useful if you are unable...
Read more >
terminal/parser: determine what to do when split escape ...
Working escape sequences over multiple write operations to PTY input pipe ... the escape sequence is split up and rendered wrong.
Read more >
Unable to Use Some Characters Like Backslash | Confluence
The "\" will escape the "*" the double backslash will break the line ... Confluence uses these characters to render its own content....
Read more >
Rust: Beware of Escape Sequences \n | by Dominic E. - Medium
A line break is a control sequence that tells the rendering device, for example, a terminal, to move the print head down one...
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