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

Parsing standard-conform ansi encodings from other applications #22

Open
mpollmeier opened this issue Nov 5, 2019 · 1 comment
Open

Comments

@mpollmeier
Copy link

Fansi doesn't currently parse many standard-conform ansi encoded strings. E.g. we're using source-highlight to render coloured sourcecode, which on the terminal renders nicely coloured text:

echo "if" > if.c
source-highlight-esc.sh if.c

So that we can display the output with fansi, I came up with four regexes to preprocess the ansi-encoded Strings before handing them to fansi.Str.apply. The comments give an example for each of the four differences, and tests are at https://github.com/ShiftLeftSecurity/codepropertygraph/blob/9a7b743/console/src/test/scala/io/shiftleft/console/PPrinterTest.scala

Would you like fansi to handle those standard-conform ansi encoded Strings, or rather make it a non-goal and not have the complexity in the parsing logic?

@lihaoyi
Copy link
Member

lihaoyi commented Dec 4, 2021

This seems like something that Fansi should be able to handle. If there's a clear spec for what the escapes should look like, we should implement it and add a comment to the implementation linking back to the spec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants