-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Problem with ANSI escape color codes on Kitty (Fedora 36 on Sway) and Centos 8 Stream. #2568
Comments
For the record, I had this exact problem and I've been able to mitigate it with colorzed-logs package and it's command ansi2txt: It would be great if bat could have an option to pre-filter out all color ANSI codes. |
I could actually make a PR for this once #2544 is merged. We would have the machinery needed to find (and thus discard) all the types of escape sequences except C0. |
Running with I think this is a man problem, not a bat problem, unless the colors are supposed to be different than they are here and I don't remember. |
Observed on Arch after man/roff update. Set MANROFFOPT as described: * sharkdp/bat#2568 * sharkdp/bat#2593 (comment)
I investigated this issue a bit to see if it's something that we can fix on our end, or if it's a problem with Without
The problem definitely is with Proposed Solution (A)We could highlight the need for With this, we should still encourage Proposed Solution (B)Alternatively, we could add export MANPAGER="sh -c 'sed -u \"s/`printf \\\\x1B`\[[0-9;]*m//g\" - | col -bx | bat -p -lman'"
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The expression itself looks messy when escaped, but what it boils down to is a BSD |
Further developments on my investigation into this:
With that discovered, I propose... Proposed Solution (C)Don't use export MANPAGER="sh -c 'sed -u -e \"s/\\x1B\[[0-9;]*m//g; s/.\\x08//g\" | bat -p -lman'" That
|
This follows proposed solution (C) in sharkdp/bat#2568
@eth-p Thanks ! Your C solution works nicely for me. |
Originally posted by @SaElAh in #2479 (comment)
The text was updated successfully, but these errors were encountered: