-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
[Bug]: Issues with reset codes #1
Comments
I think that you can't change this behavior in |
@jcubic - you can (but it's a matter of properly applying the reset codes). Which I can not seem to figure out currently. And just figured your experience with escape sequences you might be able to see what's going wrong. See here - as this is related to lolcat. (It appears I have a working formatted for piping colors from chalk bg colors etc - ie first match of BG code) correctly and returning a ANSI based result for terminal. (Stripping fg colors). |
I don't think that it will work, but you try to reset the color just after you use it. If you use it once for one character, reset it after that character. But I think that it will work with chalk, it's really simple tool just add color at the beginning of the string. TO make it work you will need to use ANSI parser inside chalk, and it's not as trivial as adding color, I don't think that chalk is doing this, but I may be wrong. |
@jcubic - when I completely remove the reset code in "ctree.js" - this is the results.
(but as fair as I know - we should be able to pipe things like these to other things). |
Sorry, no idea how to fix this. I think that when you have Unix tools, only the last in pipe should change color. |
@jcubic - correct - the last pipe is the final results with applied colors! But no worries - thank you for looking regardless! |
You can try to do what most tools are using, strip colors when using pipe. |
@jcubic - I don't want to do that. I want to apply colors with a pipe sequence ;) (I got lolcat working this way - as said so I can "pipe" into it) a lolcat modified string and apply my chalk BG to it without removing it. (Keeping both the foreground colors applied and background). |
Noting here for self - the issue is due to this line of code. Applying resets are not needed for "/" etc (xmas text). As well reset codes are not needed to be applied for most / all methods. This should solve not being able to properly add bg codes to example: |
There is a current issue with reset codes - not allowing things like
chalk
to apply background colors properly to this.As shown as below -
Mentioning the wizard @jcubic - to see if he can possibly look where the ANSI reset codes need placed to properly achieve this. As well in hopes he see's this / might want to grab this library.
The text was updated successfully, but these errors were encountered: