LinuxQuestions.org
Help answer threads with 0 replies.
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 09-01-2007, 09:31 AM   #1
muttdawg
LQ Newbie
 
Registered: Aug 2007
Location: Mobile, Al.
Distribution: Slackware
Posts: 7

Rep: Reputation: 0
default behavior for Konsole and other x-type terminals


I'm curious why Konsole displays "ls -F" and "ls --color" by default but no other x-type terminals (I'm aware of) seem to? I've never been able to figure out how to get other terminals in x to do so by default. Additionally, I've noticed in Slack versions past that "ls --color" doesn't work, at least by default, when running Konsole under an x desktop other than KDE. It's perplexing. I've read /etc/DIR_COLORS and the hidden config files in my home directory, not to mention man page for ls and documentation on various terminals, but I just can't track down the answer. Google hasn't helped much either. I love a mystery but unfortunately this one has gone on for years. With varying degrees of elbow grease I've been able to get Slack to do most of what I wanted. This isn't really a big deal since I can always just use KDE or switch to a non-x shell. It just bugs me that I can't solve the problem.
 
Old 09-01-2007, 12:56 PM   #2
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,211

Rep: Reputation: 292Reputation: 292Reputation: 292
If I understand you right, you can make an alias for ls like

alias ls='ls --color=auto'

That will make ls use colours in any terminal. I'm not sure how or why konsole does this automatically though.
 
Old 09-01-2007, 02:29 PM   #3
muttdawg
LQ Newbie
 
Registered: Aug 2007
Location: Mobile, Al.
Distribution: Slackware
Posts: 7

Original Poster
Rep: Reputation: 0
.bashrc!

Thanks Dive - I created .bashrc with this:

alias ls='ls -hF --color'

That does the trick.
 
Old 09-01-2007, 11:00 PM   #4
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 1,913

Rep: Reputation: Disabled
It's because Pat has configured konsole to launch a 'login shell' (which sources /etc/profile), while other terminal emulators are not configured this way by default.
I don't know what Pat's reason for doing this was - but I'm guessing that it's to avoid problem reports about DIR_COLORS (and other things) not working in runlevel 4 (as kdm/xdm and friends don't source /etc/profile when a user logs in). Whether this was the only reason, or even a reason at all, for that change, I don't know. Perhaps the idea was that most new users (who don't know how to solve this on their own) will be using kde and konsole, and anyone using another window manager and/or terminal emulator should be able to figure it out.

Anyway, one way to solve it is to add this to your $HOME/.bashrc
Code:
 . /etc/profile
 
Old 09-02-2007, 03:16 PM   #5
muttdawg
LQ Newbie
 
Registered: Aug 2007
Location: Mobile, Al.
Distribution: Slackware
Posts: 7

Original Poster
Rep: Reputation: 0
rworkman - thanks for the info. Somehow I'd never noticed until yesterday that there are "shells" and "login shells". My ignorance never fails to astound me, especially pertaining to Linux.
 
Old 09-02-2007, 05:31 PM   #6
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,211

Rep: Reputation: 292Reputation: 292Reputation: 292
I believe Yakuake also behaves like this and gave me problems until I twigged that it was looking for a ~/.bash_profile and not reading my ~/.bashrc.

Now I just have a .bash_profile that has one line:

[[ -f ~/.bashrc ]] && . ~/.bashrc

to ensure that .bashrc gets read by whichever term I use.
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wrapping behavior in terminals mdavidn Linux - Software 2 08-17-2007 08:23 AM
Alt+<number> - different behavior in different terminals szp Linux - General 0 03-07-2007 03:07 PM
default permissions of terminals rh_bomani Linux - General 6 05-17-2006 06:37 PM
Open several terminals in konsole jorgelon Linux - Software 9 11-01-2004 03:05 AM
konsole terminals not closing ARGGG! ptesone Debian 4 03-19-2004 12:20 PM


All times are GMT -5. The time now is 04:40 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration