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

support for ANSI colors #14

Open
yonizaf opened this issue Nov 9, 2019 · 6 comments
Open

support for ANSI colors #14

yonizaf opened this issue Nov 9, 2019 · 6 comments

Comments

@yonizaf
Copy link

yonizaf commented Nov 9, 2019

I'm using ANSI colors (ANSI escape codes) rather heavily in my scripts. Running them in nppexec console results in a lot of unreadable gibberish.

I it's possible to support colors it would be great. If not, at least filter out the codes, maybe?

@d0vgan
Copy link
Owner

d0vgan commented Nov 10, 2019

I'll consider it.
( In fact, I hate when people say "I'll consider it" - because you never know what they actually mean by that: will they just think about it or will they implement it at some point of time :) ).
I think the next version of NppExec will be able to filter the color codes. To do that, however, minimal logic of parsing the colors must be implemented anyway - I mean, at least for detection of the beginning and ending of the color code fragment of the output text.

@d0vgan
Copy link
Owner

d0vgan commented Aug 19, 2020

I have to say I am far from being familiar with ANSI colors, and the (ANSI escape codes) does not look clear to me.
Is there any sort of "formula" that describes all the possible ESC-sequences? By this "formula" I mean something like the following:

  • 2-byte seqences in form of 0x1B {x}, where {x} is in the range of [{start}, {end}] (question: what are the values of {start} and {end}?)
  • 3-byte seqences in form of 0x1B {x1} {x2}, where {x1} is in the range of [{start}, {end}] (question: what are the values of {start} and {end}?)
  • n-byte sequences in a form of 0x1B {start} {any number of bytes here} {end} (question: what are the possible values of {start} and {end}?)
  • n-byte sequences in a form of 0x1B {start_n} {exactly n bytes here} (question: what are the possible values of {start_n}?)
  • any other possible combination I did not think of

@d0vgan
Copy link
Owner

d0vgan commented Aug 19, 2020

I mean, I need to completely understand where any possible ESC-sequence begins and where exactly it ends - and only basing on this information I'll be able to do any processing, even simple filtering of the ESC-sequences.

@d0vgan
Copy link
Owner

d0vgan commented Aug 28, 2020

Added ability to remove ANSI escape sequences in https://github.com/d0vgan/nppexec/tree/develop .
Please check the latest binaries under https://sourceforge.net/projects/npp-plugins/files/NppExec/NppExec%20Plugin%20v0.6%20RC3-RC4%20%28dev%29/

@d0vgan
Copy link
Owner

d0vgan commented Nov 11, 2020

Included in NppExec v0.6.1: the ability to remove ANSI escape sequences (npe_console e1).

@pidgeon777
Copy link

If one day NppExec will be able to colourize even parts of its lines (maybe compatibility with ANSI colours?), it would be very nice.

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

3 participants