I have a line in my .bashrc that sets a color-scheme:

eval $(dircolors colorfile) 

This works as expected, setting LS_COLORS with the right string generated from 'colorfile'.

When I use screen, the bashrc file is read again, but I lose my colors. Testing, I ran dircolors colorfile in the commandline in screen, and get

export LS_COLORS

I can work-around this pretty easily, but I'm curious what's causing dircolors to act differently in screen vs not. I thought it just blindly parsed the file and outputed the string. But it must be checking some env variable or something?

Any clues? Here's some extra info: My .screenrc is blank, I'm using gnome-terminal. Dircolors version is 8.25.

I used the which command to make sure I wasn't using two different binaries (I wasn't). I checked the value of $? after running dircolors, it was 0 in both cases.


The value of $TERM is different inside screen. Accordingly your colorfile file should probably begin with

TERM screen*
TERM xterm*

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.