I have colored man pages according to:

alias man="TERMINFO=~/.terminfo/ LESS=C TERM=mostlike PAGER=less man"


man less 

looks like

enter image description here

but git blame --help is uncolored

  • 1
    Voting to move to Super User, this is not a programming question. – unwind Mar 7 '12 at 16:24
  • and man git-blame is uncolored too? – Carlos Campderrós Mar 7 '12 at 16:29
  • no man git-blame is colored, I posted a revised pic. – prafulfillment Mar 7 '12 at 19:24

That's because git help does not execute your man alias, but the plain man command. Try setting TERMINFO, LESS, TERM and PAGER in the overall environment instead of inside the man alias.

| improve this answer | |
  • Is there anyway to set the TERM variable just for man? This messes up all my other colors e.g. ls, vim, etc. – prafulfillment Mar 7 '12 at 19:23
  • @dasickis: you could put TERM=mostlike /usr/bin/man in a script, say, ~/bin/man. – Fred Foo Mar 7 '12 at 19:43
  • groff uses hard-coded escape sequences for coloring manpages, so setting TERM is largely irrelvant. – Thomas Dickey May 2 '15 at 23:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.