|
||||||
| Forums FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Programming/Scripting Questions about programming, bash scripts, perl, php, cron jobs, ruby, python, etc. |
![]() |
|
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I'm likely over complicating this, but how do you enable color in man pages? I've tried exporting the below values in .bashrc and also setting my pager to most - neither seems to work.
.bashrc contains Less Colors for Man Pages export LESS_TERMCAP_mb=$'\E[01;31m' # begin blinking export LESS_TERMCAP_md=$'\E[01;38;5;74m' # begin bold export LESS_TERMCAP_me=$'\E[0m' # end mode export LESS_TERMCAP_se=$'\E[0m' # end standout-mode export LESS_TERMCAP_so=$'\E[38;5;246m' # begin standout-mode - info box export LESS_TERMCAP_ue=$'\E[0m' # end underline export LESS_TERMCAP_us=$'\E[04;38;5;146m' # begin underline I also tried adding the following form colored manpages - nion's blog alias man="TERMINFO=~/.terminfo/ LESS=C TERM=mostlike PAGER=less man" (Compiled mostlike and used the above) I also compiled most and exported PAGER=most Nothing really seems to work. Am I missing something obvious here? Cheers, Pete |
|
|||
|
ah **** - the last solution (compiling and installing most and export PAGER=most in .bashrc works now, resourcing didn't work, just need to reopen terminal.)
You can download the most pager from here: MOST Pager Download Page However, I really wonder why the first solution (exporting the various termcap settings) does not work. Any one know why? Pete |
|
|||
|
Oddly, I found that one must install termcap for the export LESS_TERMCAP_md=$'\E[01;38;5;74m' # begin bold and such statements to have a chance or working.
Wow, weird ![]() However, despite having termcap installed, exporting LESS_TERMCAP values still don't work. Very odd. paracelsus@Callandor:~> less --version less 424 Copyright (C) 1984-2008 Mark Nudelman Still rather weird - it works so easily on CentOS. |
|
|||
|
Would you mind telling me what you have in your .bashrc and and /etc/profile exactly and the following displays?
paracelsus@Callandor:~> env | grep -i term LESS_TERMCAP_mb= LESS_TERMCAP_md= LESS_TERMCAP_me= TERM=xterm LESS_TERMCAP_ue= LESS_TERMCAP_us= LESS_TERMCAP_so= LESS_TERMCAP_se= COLORTERM=1 Strange as it should work but does not seem to for me. Must have something off in /etc/profile I am thinking. Cheers, Pete |
|
|||
|
I should have stated that the env variables are displayed as below (as they just call the color escape sequences)
paracelsus@Callandor:~> env | grep -i term LESS_TERMCAP_mb= LESS_TERMCAP_md= (displays in red) LESS_TERMCAP_me= (displays in blue) TERM=xterm LESS_TERMCAP_ue= LESS_TERMCAP_us= LESS_TERMCAP_so= (displays in grey) LESS_TERMCAP_se= COLORTERM=1 They show up okay for me when I show them with env | grep -i term but they don't actually work in displaying the man pages with less as the pager, etc. Cheers, Pete |
|
|||
|
Looking at the man page for less, I don't see any documentation that suggests that these kinds of environment variables are accepted by the standard less on openSUSE. Maybe they work in a modified or cutting edge version of less.
|
|
||||
|
On Fri, 2009-05-22 at 22:26 +0000, LewsTherinTelemon wrote:
> Would you mind telling me what you have in your .bashrc and and > /etc/profile exactly and the following displays? > > paracelsus@Callandor:~> env | grep -i term > LESS_TERMCAP_mb= > LESS_TERMCAP_md= > LESS_TERMCAP_me= > TERM=xterm > LESS_TERMCAP_ue= > LESS_TERMCAP_us= > LESS_TERMCAP_so= > LESS_TERMCAP_se= > COLORTERM=1 > > Strange as it should work but does not seem to for me. Must have > something off in /etc/profile I am thinking. Did you just cut and paste the lines from my message directly into your shell? No need to try to put into your profile when just testing. |
|
||||
|
On Sat, 2009-05-23 at 01:26 +0000, ken yap wrote:
> Looking at the man page for less, I don't see any documentation that > suggests that these kinds of environment variables are accepted by the > standard less on openSUSE. Maybe they work in a modified or cutting edge > version of less. It's there, been there for many, many years. It's just not documented. |
|
|||
|
Hey cjcox,
I did not just paste the lines into bash - I have them in my .bashrc, and if I examine them, I see they are being defined and exported correctly, for example: paracelsus@Callandor:~> env | grep -i term LESS_TERMCAP_mb= LESS_TERMCAP_md= (displays in red) LESS_TERMCAP_me= (displays in blue) TERM=xterm LESS_TERMCAP_ue= LESS_TERMCAP_us= LESS_TERMCAP_so= (displays in grey) LESS_TERMCAP_se= COLORTERM=1 That is what is so odd about this. There they are, displayed in color, everything looks great. echo $PAGER shows less is set, and termcap is installed - but man pager are still not in color. (I did comment out unset termcap in /etc/profile - made no difference.) Would you mind sharing your complete /etc/profile, .bashrc and what versions of termap and less you are using? Thanks! Pete |
![]() |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|