LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-04-2006, 06:10 PM   #1
davidVK
LQ Newbie
 
Registered: Apr 2006
Posts: 3

Rep: Reputation: 0
color-ls not working in Konsole


Using the same /etc/profile I used in slack9,9.1,10.0,10.1 and 10.2 without problem I do not get color-ls working in slackware 11.0. Otherwise installed flawlessly on three different machines.
Is this a slackware problem or KDE 3.5 deficiency?
davidVK

Thank you tobyl.
I had saved profile to profile.orig then imported slackware 10.2 /etc/profile. Returning to profile that came with slackware 11.0 allowed color-ls to work, but I needed aliases and PS1 from before so I added them to the file one at a time. There was a line "alias ls='ls -F'" which dated back to the 9.0
installation and when added killed color-ls. Interestingly, it can be used from the command line without killing the color but the option adds '/', '@' and '*' after filename which ls without option does anyway.
My old profile had the same "# Set up the LS_COLORS . . . " as you mentioned and it works with or without that 'if' clause.
davidVK

Last edited by davidVK; 11-06-2006 at 03:45 PM.
 
Old 11-05-2006, 08:37 AM   #2
tobyl
Member
 
Registered: Apr 2003
Location: uk
Distribution: slackware current
Posts: 768

Rep: Reputation: 64
If you upgraded, have you got a profile.new in /etc?
If so, try saving your old profile and renaming the profile.new to profile

I think you can test without restarting your session with
# source /etc/profile

If it is a fresh install, I guess you will need to trawl through /etc/profile, /etc/DIR_COLORS and /etc/profile.d/coreutils-dircolors.sh and figure out what needs to be altered.

my old /etc/profile contained

# Set up the LS_COLORS and LS_OPTIONS environment variables for color ls:
if [ "$SHELL" = "/bin/zsh" ]; then
eval `dircolors -z`
elif [ "$SHELL" = "/bin/ash" ]; then
eval `dircolors -s`
else
eval `dircolors -b`
fi

but I cant remember if I added those lines, or if they were already there, in any case they do not appear in the later version of the file.

files in your home directory will of course override system-wide settings in /etc, so you may also need to visit ~/.bashrc, ~/.bash_profile ~/.dircolors
- but then you would know if you had modified them...

tobyl

Last edited by tobyl; 11-05-2006 at 08:41 AM.
 
Old 11-06-2006, 06:03 PM   #3
dracolich
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 1,274

Rep: Reputation: 63
I think konsole and other terminals read the ~/.bashrc file. What I did is replace the .bashrc with a symlink to profile.
 
Old 11-07-2006, 07:34 AM   #4
xflow7
Member
 
Registered: May 2004
Distribution: Slackware
Posts: 215

Rep: Reputation: 45
Quote:
Originally Posted by davidVK
Using the same /etc/profile I used in slack9,9.1,10.0,10.1 and 10.2 without problem I do not get color-ls working in slackware 11.0. Otherwise installed flawlessly on three different machines.
Is this a slackware problem or KDE 3.5 deficiency?
davidVK

Thank you tobyl.
I had saved profile to profile.orig then imported slackware 10.2 /etc/profile. Returning to profile that came with slackware 11.0 allowed color-ls to work, but I needed aliases and PS1 from before so I added them to the file one at a time. There was a line "alias ls='ls -F'" which dated back to the 9.0
installation and when added killed color-ls. Interestingly, it can be used from the command line without killing the color but the option adds '/', '@' and '*' after filename which ls without option does anyway.
My old profile had the same "# Set up the LS_COLORS . . . " as you mentioned and it works with or without that 'if' clause.
davidVK
Not sure if you're still fighting with this, but probably the reason that

Code:
alias ls='ls -F'
kills the color when it appears in /etc/profile is because it overwrites the alias that is set up by /etc/profile.d/coreutils-dircolors.sh (which itself is run from /etc/profile; line 73-ish if it's the same as mine).

The alias set up by /etc/profile.d/coreutils-dircolors.sh is set to include the -F and --colors options (among others) through the use of the $LS_OPTIONS environment variable.

When you do ls -F only from the command line, it uses the alias with the $LS_OPTIONS options and just appends -F on the end so it doesn't erase the other options.

Not sure why it worked before with alias ls='ls -F' in /etc/profile other than maybe the order things were done in the scripts. If your alias ls='ls -F' appeared before /etc/profile set up it's own alias, then it would have been overwritten but the default alias includes -F so you wouldn't have noticed.

Hope that helps.

Dave
 
Old 11-07-2006, 10:18 AM   #5
alienux
Member
 
Registered: Sep 2006
Location: Dayton, Ohio
Distribution: Slackware 12, Fedora Core, PCLinuxOS
Posts: 194

Rep: Reputation: 30
I actually noticed this to be an issue on any distribution that I'm using KDE 3.5 on. I just created/modified .bashrc and added

Code:
alias ls="ls --color"
to get mine to ls in color on a couple of boxes (one with slack and one with fedora 5).
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Terminal background color not working mijohnst Linux - Newbie 2 10-03-2005 04:11 PM
how to change the foreground color of konsole SuSe 9.2 KDE GnaM Linux - Newbie 1 12-31-2004 09:01 AM
Terminal Konsole not working for users in KDE 3.2 wallior Linux - Newbie 3 03-12-2004 09:12 PM
big problem! konsole commands not working!!! rahmed Mandriva 1 03-03-2004 07:11 PM
how to change the color of the fron on Konsole?? sirpelidor Linux - Newbie 2 11-14-2003 07:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:44 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