LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 07-06-2011, 10:19 AM   #1
Gerard Lally
Senior Member
 
Registered: Sep 2009
Location: Brú na Bóinne, IE
Distribution: Slackware, NetBSD
Posts: 1,520

Rep: Reputation: 984Reputation: 984Reputation: 984Reputation: 984Reputation: 984Reputation: 984Reputation: 984Reputation: 984
How to get dircolors back


Changed my shell to zsh and somewhere along the way lost dircolors. When I type ls I get directories, files, symlinks, etc., in colour but when I tab to autocomplete commands in the shell the colours have disappeared. Not sure what I've done because I've been experimenting with rxvt-unicode as well, at the same time. If it's any use echo $TERM gives me rxvt-unicode-256color. Exporting $TERM as xterm gives the same result, i.e, no colours.

I've tried the following:

Code:
cat /etc/DIR_COLORS > ~/.dircolors
As I say, for some reason ls does bring up files in colour, but tabbing to autocomplete does not.

The following used to come up with a list of alternatives in colour, for example, but not now:

Code:
vim .fvwm/con(press TAB here to autocomplete one of {config | configFvwmPager | configFvwmBacker)

Last edited by Gerard Lally; 07-06-2011 at 10:30 AM.
 
Old 07-06-2011, 02:58 PM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian + kde 4 / 5
Posts: 6,837

Rep: Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987
I've never seen colors in tab completions. It would have to be something set up in the completion functions, I suppose. Something distro-specific perhaps?

In any case, it likely has nothing to do with ls/dircolors, as tab completion is a shell feature.

Unless I'm misunderstanding you in some way.
 
Old 07-06-2011, 04:01 PM   #3
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
As far as I know the colored output of the ls command is done with an alias
Code:
alias ls='ls --color'
which by default works for bash. I suppose that if you use another shell you'll have to configure this alias.

Markus
 
Old 07-07-2011, 02:11 PM   #4
Gavin Harper
Member
 
Registered: Feb 2010
Location: Finland
Distribution: Slackware
Posts: 169

Rep: Reputation: 24
Quote:
Originally Posted by markush View Post
As far as I know the colored output of the ls command is done with an alias
Code:
alias ls='ls --color'
which by default works for bash. I suppose that if you use another shell you'll have to configure this alias.

Markus
And some other useful aliases, including and inaddition to that which was listed above (from my zshrc):

Code:
alias ls="ls --color=auto"
alias grep="grep --color=auto"
alias tree="tree -C"
 
Old 07-21-2011, 01:29 PM   #5
Gerard Lally
Senior Member
 
Registered: Sep 2009
Location: Brú na Bóinne, IE
Distribution: Slackware, NetBSD
Posts: 1,520

Original Poster
Rep: Reputation: 984Reputation: 984Reputation: 984Reputation: 984Reputation: 984Reputation: 984Reputation: 984Reputation: 984
Hi all. Sorry about the delay replying. I am still none the wiser I'm afraid, but just now I copied my zsh initialization files (.zshrc, .zshenv, etc.) from my own user account to /root, and when I changed root's shell from bash to zsh I got colours when I pressed tab to complete. The colours were the same as those I would get if I did "ls -la"

But when I opened a new terminal and typed su to change to root, and then zsh to change from bash to zsh, the colours were gone again! I don't understand this! The very same procedure brought up the colours the first time I used zsh under root but not since!

I know this isn't a big problem and to some people indeed it will appear trivial but it does help my eyesight to have a bit of clarity when using the shell.
 
  


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
edit ~/.dircolors unixshell101 Linux - Software 9 12-26-2007 01:36 AM
dircolors in freebsd d0wn_under *BSD 4 10-08-2004 05:58 AM
dircolors error erikm103 Linux - Software 0 12-07-2003 11:01 PM
Aterm and dircolors Wynd Linux - Software 1 06-21-2003 11:28 PM
Should I use dircolors? Xiangbuilder Linux - General 4 04-08-2003 08:53 PM

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

All times are GMT -5. The time now is 09:29 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration