HackerTrans
TopNewTrendsCommentsPastAskShowJobs

webpro

no profile record

Submissions

Inspect ANSI control codes and escape sequences

ansi.tools
115 points·by webpro·il y a 12 mois·51 comments

comments

webpro
·il y a 12 mois·discuss
Some of the issues mentioned in this thread have been improved, including private CSI sequences, default param values, and cancellation + substitution.
webpro
·il y a 12 mois·discuss
The lexer and parser handled it perfectly first try. The HTML renderer had a few issues though, but it's being rendered reasonably well now. The torture test has been added to the package tests and to the website as an example.
webpro
·il y a 12 mois·discuss
There is some recovery in the lexer, but would love to learn what would make it crash! The url you provide gives a 404.
webpro
·il y a 12 mois·discuss
Raw input should be cool now (there's "raw" in the examples as well)
webpro
·il y a 12 mois·discuss
What would prevent you from starting? Could be fun :)
webpro
·il y a 12 mois·discuss
Emojis and other unicode characters may or may not be rendered as a single-width character. I've been splitting hairs and strings.

The tool currently counts any unicode character as a single-width one.
webpro
·il y a 12 mois·discuss
Thanks, this is great feedback. I'll see what I can do, stay tuned.
webpro
·il y a 12 mois·discuss
There is https://github.com/webpro/ANSI.tools/blob/main/packages/pars... and others
webpro
·il y a 12 mois·discuss
Thanks. Agreed. The way I see it, ignore the noise and there might be something in there.
webpro
·il y a 12 mois·discuss
That's some interesting feedback, thanks for sharing. I'll see what I can extract and apply from it. Please bear with me, this is only my initial take on the whole concept (and as you point out, it isn't that trivial). Didn't have much examples to be inspired by, but we're on our way anyway.
webpro
·il y a 12 mois·discuss
Thanks! It's all open source (including the tokenizer/parser), so feel free come collaborate on GitHub.
webpro
·il y a 12 mois·discuss
The parser has, but not the HTML renderer indeed. Using a third-party lib for that currently, but noticed the limitations too. Might replace it with my own!
webpro
·il y a 12 mois·discuss
Thanks for sharing, haven't seen that one yet. Will see if I can borrow ideas from it.
webpro
·il y a 12 mois·discuss
At least I tried to make it look like a 1993 website
webpro
·il y a 12 mois·discuss
Got to start somewhere! Didn't see many examples to get inspired by either. Here's the full table: https://ansi.tools/lookup. This is my initial take on it. Please bring in the corneriest cases! It's open source so bug reports, RFCs and pull requests are most welcome.
webpro
·il y a 12 mois·discuss
Working with and debugging ANSI control codes and escape sequences can be a challenge.

This free web-based tool helps to inspect the input, visualize colors and styling, and list control codes. By using a proper tokenizer and parser (not just regex hacks), it supports all sorts of control codes. The parser is open source and available too (find links in "about").

Type or paste text in the black text area, or try out the examples. Use the lookup table to filter & find specific codes.

Feedback welcome, I’d love to know what’s confusing, missing, or especially useful.