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

Browser hangs up when escaped brackets are echoed #470

Closed
paulsmirnov opened this issue Feb 26, 2019 · 2 comments
Closed

Browser hangs up when escaped brackets are echoed #470

paulsmirnov opened this issue Feb 26, 2019 · 2 comments
Labels
Bug critical resolved if issue is resolved, it will be open until merge with master

Comments

@paulsmirnov
Copy link

Expected behavior

I expect to be able to output any text to the terminal. I understand that I might need to escape some special characters used for formatting, e.g. square brackets (is any helper method available?). In case I escape them, everything should work fine.

Actual behavior

When I echo a text containing escaped brackets (e.g. 'a\\[i\\]=42'), browser hangs up. Note that I have to escape them at least inside color formatting syntax ([[b;white;red]text]).

Steps to reproduce

See this code pen: https://codepen.io/paulsmirnov/pen/ZPYavo
Uncomment the tagged line to experience the issue.

P.S. Note that you don't need to use formatting syntax to hang up, simple echo is enough: term.echo(msg);. I've just decided to show you a motivation behind escaping.

Browser and OS

  • Windows 10
  • Google Chrome 72.0.3626.119 (Official Build) (64-bit)
@jcubic
Copy link
Owner

jcubic commented Feb 26, 2019

Thanks for the report. This is very bad even this don't work:

term.echo('Display [[b;white;red]' + $.terminal.escape_brackets('a[i]=42') + '] and hang up!');

It don't hang locally when I tested but the output is totally broken also nested formatting give weird output and make this even worse.

@jcubic
Copy link
Owner

jcubic commented Apr 5, 2019

The problem was that unix formatter (from_ansi) was meta formatter (it had __meta__ == true marker) so it processed whole command not only between formatting like normal formatter.

This is changing how unix formatting works but I think it's fine. I don't think that it will break someones code and if it do he can add back __meta__ marker.

@jcubic jcubic added the resolved if issue is resolved, it will be open until merge with master label Apr 5, 2019
@jcubic jcubic closed this as completed Apr 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug critical resolved if issue is resolved, it will be open until merge with master
Projects
None yet
Development

No branches or pull requests

2 participants