LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-07-2005, 11:33 PM   #1
kz26
Member
 
Registered: Aug 2005
Location: USA
Distribution: Fedora, Ubuntu, Backtrack
Posts: 70

Rep: Reputation: 15
Unhappy shell color syntax/highlighting on FC4


I am running a Fedora Core 4 box with a tcsh shell. Everything works fine, except for one thing.

On Red Hat Linux 9 there used to be color highlighting in vi and also when you called up a man page.

On Fedora Core 4, however, instead of color, I get just ugly bold black/white letters when there
should be color.

I have already tried 'setenv TERM xterm-color' from the vi docs - while this fixes vi,
man pages, pine, etc. still do not have color.

While this may not be a bug, I have a strong personal preference for this. Anyone have
any fixes?
 
Old 08-08-2005, 03:24 AM   #2
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
In RH9 you would alter the .bashrc file in your home directory, adding the following at the end:[code]alias ls='ls _color=auto'

for the ls command to show files in colour.
(And, globally, you put it in /etc/bashrc.)

Of course - this was for the (default) bash shell. And only worked for ls.

The man page for tcsh is quite exhaustive. There is advice under LS_COLORS which should help with man pages.

but: in my FC4 system, I can modify the terminal parameters by selecting edit > current profile ... so long as colours are turned on everything is in colour.
 
Old 08-08-2005, 09:05 AM   #3
kz26
Member
 
Registered: Aug 2005
Location: USA
Distribution: Fedora, Ubuntu, Backtrack
Posts: 70

Original Poster
Rep: Reputation: 15
I am using xterm... in 'ls' there's color by default, and I got color in vi sort of working,
but in everything else there's no color.
 
Old 08-08-2005, 02:48 PM   #4
kz26
Member
 
Registered: Aug 2005
Location: USA
Distribution: Fedora, Ubuntu, Backtrack
Posts: 70

Original Poster
Rep: Reputation: 15
Let me elaborate... colors in 'ls' work fine - but when I use vi to create a new file in xterm, the tilts (~) that represent blank lines are in color (blue), but when, say, I press 'i' for insert or 'R' for replace, the vi statusbar at the bottom of my xterm is still an ugly bold black color.

Additionally, when I call up a man page, instead of colors, I get bold black.

Also in pine, I had colored (blue) links in my messages on RH9. Again, on FC4, I only
get bold black text instead of color.

This seems like an odd issue (the color and highlighting were fully working on FC2,
but has stopped working for me on FC3 and 4.

Additionally, this issue doesn't only affect the tcsh shell - bash also has this problem.

Again, any help would great help me (and my eyes).
 
Old 08-09-2005, 04:40 AM   #5
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Did you try altering the profile colours from the gui?
(Try the obvious first...)

My FC4 has all the colours working by default ... I have altered the profile colours so the background is "transparent" and the text is in grey. Boldface is white. vi and so on all show proper colours.

/etc/bashrc contains the bash settings. This is what mine contains:
Code:
# /etc/bashrc

# System wide functions and aliases
# Environment stuff goes in /etc/profile

# by default, we want this to get set.
# Even for non-interactive, non-login shells.
if [ $UID -gt 99 ] && [ "`id -gn`" = "`id -un`" ]; then
        umask 002
else
        umask 022
fi

# are we an interactive shell?
if [ "$PS1" ]; then
    case $TERM in
        xterm*)
                if [ -e /etc/sysconfig/bash-prompt-xterm ]; then
                        PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm
                else
                PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\007"'
                fi
                ;;
        screen)
                if [ -e /etc/sysconfig/bash-prompt-screen ]; then
                        PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen
                else
                PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\033\\"'
                fi
                ;;
        *)
                [ -e /etc/sysconfig/bash-prompt-default ] && PROMPT_COMMAND=/etc/sysconfig/bash-prompt-default
            ;;
    esac
    # Turn on checkwinsize
    shopt -s checkwinsize
    [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "
fi

if ! shopt -q login_shell ; then # We're not a login shell
        for i in /etc/profile.d/*.sh; do
            if [ -r "$i" ]; then
                . $i
            fi
        done
        unset i
fi
# vim:ts=4:sw=4

# alias interactive [mjm-modification]
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
 
Old 08-09-2005, 03:06 PM   #6
kz26
Member
 
Registered: Aug 2005
Location: USA
Distribution: Fedora, Ubuntu, Backtrack
Posts: 70

Original Poster
Rep: Reputation: 15
Simon, I tried using your bashrc file and my problem is still there. What do you mean by alternating the colors in the GUI? I am using xterm, not gnome-terminal.

BTW, this problem exists in both the bash and tcsh shells, if that helps. I tried setting my TERM variable to a bunch of different settings, but it had no effect.
 
Old 08-09-2005, 11:46 PM   #7
jayemef
Member
 
Registered: Aug 2005
Location: Juniata College, PA
Distribution: Ubuntu, Slackware
Posts: 67

Rep: Reputation: 15
To enable syntax colors/highlighting in Vi, try creating/editing ~/.vimrc and adding the line
Code:
syntax enable
Save and exit. You should now have color in Vi.
 
Old 08-10-2005, 11:38 PM   #8
kz26
Member
 
Registered: Aug 2005
Location: USA
Distribution: Fedora, Ubuntu, Backtrack
Posts: 70

Original Poster
Rep: Reputation: 15
Talking

I posted 2 pics of my problem.

--EDIT-- URLs updated
Screen1
Screen2
--EDIT--

As you can see from the first screenshot, I have colors in vi, but the statusbar at
the bottom is still black.

The 2nd screenshot shows a man page - as you can see, there is no color at all.

Under RH9, I had full color in both.

Last edited by kz26; 08-11-2005 at 02:30 PM.
 
Old 08-10-2005, 11:47 PM   #9
jayemef
Member
 
Registered: Aug 2005
Location: Juniata College, PA
Distribution: Ubuntu, Slackware
Posts: 67

Rep: Reputation: 15
Sorry, I can't see your screenshots. I'm getting forwarded to an ad page. But if you aren't getting a status line in Vi, add the following to your ~/.vimrc file:
Code:
set ruler
Additionally, you can play with
Code:
set statusline=...........   " Specify what you want to include in your status line
set laststatus=2   " Always show the status line

Last edited by jayemef; 08-10-2005 at 11:54 PM.
 
Old 08-11-2005, 02:31 PM   #10
kz26
Member
 
Registered: Aug 2005
Location: USA
Distribution: Fedora, Ubuntu, Backtrack
Posts: 70

Original Poster
Rep: Reputation: 15
Picture URLs updated, please check the post again...
 
Old 08-11-2005, 08:54 PM   #11
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
OK - I think I see your problem.

Was the background always yellow or did you adjust that yourself?

The man pages are supposed to be monochrome. They were that way for me in RH9, and FC2 as well as FC4. Though I think you can set the highlight and boldface colour as something different ... this is done for the terminal config. Just like the background colour.

see the xterm man pages --- of just use gnome terminal.
 
Old 08-11-2005, 11:31 PM   #12
kz26
Member
 
Registered: Aug 2005
Location: USA
Distribution: Fedora, Ubuntu, Backtrack
Posts: 70

Original Poster
Rep: Reputation: 15
I set the window background to yellow on purpose - I like different-colored windows.

If I wanted different-colored text in the man pages, how would I set the highlight and boldface
colors for xterm?
 
Old 08-12-2005, 12:48 AM   #13
Ugat
LQ Newbie
 
Registered: Aug 2005
Location: Philippines,CDO
Distribution: Fedora
Posts: 2

Rep: Reputation: 0
I agree to
 
Old 08-12-2005, 07:10 AM   #14
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
OK - I am using FC4, but I am using the gnome console.

From the console menue, I can select:
edit>profiles>myprofile>colors

I have selected a built in scheme for normal text (grey on black). In this setting, normal text is grey (doh!) and highlighted text is white. I've selected a transparent background and set transparency at about 30% ... so I see this against a dim version of my desktop wallpaper.

I can also cutomise the colour scheme if I want to - say to crimson on clover?

In the man pages, the "highlight" is the same colour as the text only darker for light backgrounds and lighter for dark backgrounds.

(To see why this may be, try this: man ls > ls.txt - then view ls.txt.)

There is also a colour pallette - with built in schemes and a custom option. eg. if you want the hyperlinks in lynx to be red while the text is browney-grey on a parchment coloured background ... then drag the pale yellow to the background tile, the pale brown to the foreground tile, and the crimson to the dark blue tile. e-voila. Of course, this is your encoding for everything using that terminal profile.
 
Old 08-12-2005, 09:00 AM   #15
kz26
Member
 
Registered: Aug 2005
Location: USA
Distribution: Fedora, Ubuntu, Backtrack
Posts: 70

Original Poster
Rep: Reputation: 15
Ok, I'll try that. Would you happen to know the commandline switches to do the same
in xterm?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
syntax highlighting/color FC4/vi overlord73 Fedora 3 07-15-2005 04:48 AM
syntax highlighting rohr Programming 3 07-06-2005 07:07 AM
vim syntax highlighting MiniMe001 Linux - General 2 06-19-2005 12:08 PM
Bluefish - Syntax Highlighting (Background Color) Quasaur Linux - Software 1 11-18-2003 03:21 PM
emacs color-syntax highlighting with perl SerfurJ Linux - Software 2 09-22-2003 09:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration