0

According to all I've read LS_COLORS with di=01;34 should mean bold blue.

No matter what setting I try I cannot get anything except white on black (I assume when my setting is incorrect) or this ugly, standard blue on green.

enter image description here

I have tried every permutation of di=**;**: or, depending on who you ask dir=**;**: to no avail and no other result except vanilla or ugly.

What is going on here?

Windows 10 / WSL Ubuntu 20 / Windows Terminal

LS_COLORS

rs=0:di=01;34:ln=01;36:mh=00:pi=40;33
:so=01;35:do=01;35:bd=40;33;01
:cd=40;33;01:or=40;31;01:mi=00:su=37;41
:sg=30;43:ca=30;41:tw=30;42:ow=34;42
:st=37;44:ex=01;32: *.tar=01;31
:*.tgz=01;31:*....
2

2 Answers 2

5

LS_COLORS is not ignored. It's causing the blue on green, which is absolutely not standard. That blue on green is ugly by design: it signals a directory that is world-writable, which is normally rare, but are common on WSL which doesn't use Unix permissions the normal way.

This comes from the ow setting in LS_COLORS. Replace ow=34;42 by ow= so that the setting doesn't apply.

shopt -s extglob
LS_COLORS=${LS_COLORS/:ow=*([^:]):/:ow=:}
1
  • Shouldn't extglob be disabled after running those commands? by running this command: shopt -u extglob
    – s.ouchene
    Apr 10 at 2:05
3

The ow=34;42 is what's being printed. If you do a

dircolors --print-database

you may notice this line:

OTHER_WRITABLE 34;42 # dir that is other-writable (o+w) and not sticky

which is the ow code. That's telling you that you have a world-writable directory. As I commented in LS_COLORS mixing matching criteria, e.g. file extension and hardlink

However, GNU ls chooses only one scheme for coloring each file.

In this case, it sees something more "interesting" in the table than just the file/directory type, and uses that. Reading the source-code is by the way the only way to understand GNU ls, since its documentation is weak.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .