Open injust opened 2 weeks ago
Hi,
I have a similar issue, I think. I use zsh 5.9, bat 0.24 (installed via arch official repository) and I have MANPAGER=sh -c 'col -bx | bat -l man -p'
too.
Not everything is orange for me but I have some color character which make it hard to read.
It works better with MANPAGER="bat -l man"`
But sometimes the behavior is very strange.
Let me know if you need more info.
Thank you
@flohw Think your issue is different.
Can you check your groff version using
groff -v
And if it's 1.23.0, try adding MANROFFOPT='-c'
and that should fix it.
After some experimentations with my env vars, defining this variable worked fine. Thank you
Some explanation if anyone struggle to configure it to their need:
# For global use across the system (in your bashrc/zshrc)
export MANROFFOPT='-c'
# For local script global useage
MANROFFOPT='-c'
man -P "$MANPAGER' --paging always'" <man entry>
# For online usage
MANROFFOPT='-c' man -P $MANPAGER <man entry>
Note that I haven't tested each one and only based them on my experience. I hope to not have make mistake. :-)
What steps will reproduce the bug?
set -Ux MANPAGER "sh -c 'col -bx | bat -l man -p'"
type --help
,fish_add_path --help
, etc.What happens? Anything that isn't indented is syntax highlighted orange, ignoring any actual formatting.
What did you expect to happen instead? The man page should be highlighted reasonably.
I think this might be happening because fish's man pages aren't indented? But I couldn't find anything suggesting that man page sections have to be indented, so if this is the reason, then the syntax highlighting should be able to tolerate fish's non-indented man page format.
How did you install
bat
?Homebrew
Software version
bat 0.24.0
Operating system
macOS 14.5 (Darwin 23.5.0)
Command-line
Environment variables
System Config file
Could not read contents of '/etc/bat/config': No such file or directory (os error 2).
Config file
Could not read contents of '/Users/jsu/.config/bat/config': No such file or directory (os error 2).
Custom assets metadata
Custom assets
Compile time information
Less version