-
-
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
man
page doesn't get colorized if the default theme's changed
#2115
Comments
Yes, I just came here to search for the same problem. |
I confirm this issue on Arch Linux, |
Thanks for reporting. It seems these other color schemes are not targeting the minimum viable scopes as recommended by ST. For example, our The solution will be to get the third party color schemes updated - either by patching them in this repository, or by making fixes in the upstream repositories and then updating |
Having said that, it could be that I'm biased because I chose to use those scopes for our Manpage syntax highlighting. I understand that it would likely take less effort to adjust the scopes we use to those which are more commonly targeted by color schemes. So it is conceivable that we might accept a PR adjusting the scopes in the Manpage syntax definition to resolve this issue. |
@icy-comet, could it be that what you're trying to colorize is a --help message rather than a man page? If that's the case, I've been working on a sublime syntax to scope help messages. It's still a work in progress but you may find it useful. I plan to stabilize it over the next week and PR it to bat in 1-2 weeks. @keith-hall, I tackled theme coverage by multi-scoping, with mostly unrelated scopes. You may think it a sacrilege (it is 😅) but if you're willing to ignore scope meaning, here's a couple of changes that improve theme coverage by a bit: command options from entity.name to entity.name.function and multi-scoping headings as entity.name.section. The commits' stat shows a list of the themes that changed (usually for the best). Of course, there are surely better combinations of (totally unrelated) scopes, to cover the themes built into bat. Mine is just a quick & dirty assignation I may revisit later on. |
I hit this one as well:
With man pages containing code snippets its not too bad: But for all command line utils man pages, bat themes do nothing really.
|
For everyone hitting this issue, this is my workaround: export MANPAGER="sh -c 'col -bx | bat --theme=default -l man -p'"
man 2 select |
thx. The man 2 select is just an example, I guess. |
These are the official instructions on how to use |
I see, but also in the instructions it is as far as I understand an example. |
@8FordPrefect8 yes sure, it is just an example to see a colorized man page, and actually I think it should be a more straightforward example, such as |
I just tried and Either way, I'll keep using the See this comparison for an example:
Edit: and this is not a theme issue, here is what I see when I use the default theme with |
Describe the bug you encountered:
I tried playing with multiple options, but as soon as I change the default theme to anything else, colorization on
man
pages break.I tried setting theme to
ansi
,base16
,base16-256
,OneHalfDark
, and1337
. I also set--color=always
, but that didn't help either even though I explicitly specify the language asman
while piping intobat
.This can be reproduced by invoking
bat
onbat
's help itself:bat --help | bat -l man
. Highlighting works with the default theme, but not with others -- only a few words get highlighted....
What did you expect to happen instead?
Syntax highlighting on the
man
page just as it functions with the default theme....
How did you install
bat
?I used Scoop to install
bat
.bat version and environment
I use PowerShell 7.2.1 that supports Unicode by default and Windows Terminal that has
xterm-256
terminal capabilities.This the output on running
bat --help | bat -l man --diagnostic
:Software version
bat 0.20.0 (0655ecf)
Operating system
Windows 6.2.9200
Command-line
Environment variables
Config file
Compile time information
Less version
The text was updated successfully, but these errors were encountered: