am not getting colorized output
bdarcus opened this issue · comments
I installed this plugin per instructions, using fisher.
If I do man less
, I don't get any color.
If I add cless git help log
, also per docs, I also don't get any color.
I'm a fish newbie, but any tips on where to look?
Hi, can you give me the output if functions man
please?
And what OS are you running on?
My guesses right now
- Your OS doesn't use termcap (https://unix.stackexchange.com/questions/108699/documentation-on-less-termcap-variables)
- Your man is not configured to use LESS
I'm on Fedora Linux, 34 beta to be specific.
Oh, and output:
functions man
# Defined in /home/bruce/.config/fish/functions/man.fish @ line 1
function man --description 'Run man with added colors'
cless /usr/bin/man $argv
end
If I do this, I get colors, however but with some funky artifacts:
set -x MANPAGER "sh -c 'col -bx | bat -l man -p'"
set -x MANROFFOPT "-c"
Hi, that is very strange. When you do set -x MANPAGER "sh -c 'col -bx | bat -l man -p'"
, you are configuring your man to use bat
, which provides color out of the box, so that is not using this plugin.
I think it's possible your binary at /usr/bin/man
is not using LESS for its paging. Can you try removing set -x MANPAGER "sh -c 'col -bx | bat -l man -p'"
and then testing your environment to see if there's still a MANPAGER
var being set?
Worst case, you could try this other fish plugin that does almost the same thing: https://github.com/decors/fish-colored-man
It is very strange.
I dropped out of fish to the default bash shell, and PAGER
and MANPAGER
are not set.
Pretty sure less
is default on Fedora, but I have no idea how to confirm that!
In any case, I'll close this; I'll figure something out; the bat
solution seems good ATM.
Thanks!
I'm guessing it's because you need to set this env like I did, also on Fedora:
export GROFF_NO_SGR=1
...as mentioned here in the comments:
https://unix.stackexchange.com/a/147/27193
man-colored-fish sets that for Fedora as well:
https://github.com/decors/fish-colored-man/blob/1ad8fff696d48c8bf173aa98f9dff39d7916de0e/functions/man.fish#L18