Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have colored man pages according to:

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

so

man less 

looks like

enter image description here

but git blame --help is uncolored

share|improve this question

migrated from stackoverflow.com Mar 7 '12 at 22:20

This question came from our site for professional and enthusiast programmers.

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
up vote 4 down vote accepted

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.

share|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
    
Thanks @larsmans that worked put that into my zshrc. – prafulfillment Mar 7 '12 at 22:02
    
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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