2

I've tried to copy all sort of color schemes to try and get colors in the man pages -- for example, like what most does by default. But I've never been successful to get something like tmux man-page search highlighting to highlight man pages, even with the given LESS_TERMCAP_* given in example.

See what I get at http://screencast.com/t/Z4i9AEQ0. The bold section titles stay bold, but never get colored. What am I missing?

Here is the relevant part of my .zshrc:

PAGER="less"

# Colored man pages:
# http://linuxtidbits.wordpress.com/2009/03/23/less-colors-for-man-pages/
export LESS_TERMCAP_mb=$'\E[01;31m'     # enter_blink_mode
export LESS_TERMCAP_md=$'\E[01;38;5;74m' # enter_bold_mode
export LESS_TERMCAP_so=$'\E[38;5;016m\E[48;5;220m' # enter_standout_mode
export LESS_TERMCAP_us=$'\E[04;38;5;146m' # enter_underline_mode
export LESS_TERMCAP_me=$'\E[0m'         # exit_attribute_mode
export LESS_TERMCAP_se=$'\E[0m'         # exit_standout_mode
export LESS_TERMCAP_ue=$'\E[0m'         # exit_underline_mode

# tailoring `less'
LESS="--quit-at-eof --ignore-case --long-prompt --raw-control-chars"

And here is my .minttyrc:

BoldAsColour=yes
BoldAsFont=no
Font=Consolas
FontHeight=10
RightClickAction=paste
Rows=43
ScrollbackLines=100000
Term=xterm-256color

PS- This has been asked on the Cygwin ML, but did not get any answer.

Community
  • 1
  • 1

2 Answers2

2

One option is to export MANROFFOPT="-c" in your shell rc file. This has the same effect as GROFF_NO_SGR=1, but only affects man. I'm not sure if groff is used for anything else besides man pages, but this seems safer to prevent unintended side effects.

Reference: groff(1) and man(1).

dc46and2
  • 147
  • 4
0

Including the following in my .bashrc worked for me - export GROFF_NO_SGR=1

Explanation and idea found at: https://wiki.archlinux.org/index.php/Man_page#If_less_doesn.27t_display_color_man_pages

P. Cox
  • 1
  • 2