9

On the new Bash on Ubuntu on Windows (10) app, I have tried to change the directory colors from blue to some thing more visible but haven't been able to change some file/directory colors for some reason. How do I change all of the directory/file colors? My .bashrc file is currently set to have color prompt on the file and directory colors to be green and other bright colors. The settings are:

LS_COLORS=$LS_COLORS:'di=1;31:fi=0;31;bd=0;32:fi=0;33:cd=0;96';
export LS_COLORS

if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[0;31m\]\u@\h\[\033[0,31m\]:\[\033[0;31m\]\w\[\033[0,31m\]\$ '

Some files and folders have changed colors corresponding to my .bashrc file but others don't for some reason.

Some example screenshots: enter image description here

enter image description here

enter image description here

3 Answers 3

10

When ls -l displays windows files outside the wsl the other writable causes the green background. As Schmendrick van der Distel said, create a dircolors in your home directory. Then change STICKY_OTHER_WRITABLE and OTHER_WRITABLE as below to remove the background.

dircolors -p > ~/.dircolors

Change in .dircolors to these values:

STICKY_OTHER_WRITABLE 31;00 # dir that is sticky and other-writable (+t,o+w)
OTHER_WRITABLE 31;00 # dir that is other-writable (o+w) and not sticky

Restart bash

3

I've had the same problem and solved it in the following way:

In my ~/.bashrc file I found the lines:

test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'

As I found no file named .dircolors in my home-directory, I exported the standardconfiguration via dircolors -p > ~/.dircolors

Now I've changed the line DIR 01;36 # directory to DIR 01;34 # directory (changed the color from blue to cyan), saved the file and restarted the BashonWindows.

Hope it will help

1

Another option (or the only one that really worked for me) is to install the solarized-dark theme from https://github.com/neilpa/cmd-colors-solarized

(close/open the console window to activate)

2
  • This works bash shell as well ? The link talks of only powershell.
    – Jagannath
    Commented Dec 9, 2016 at 3:54
  • @Jagannath it changes the colors for the Console window which is used by Bash as well as PowerShell and Cmd.
    – laktak
    Commented Dec 9, 2016 at 21:12

You must log in to answer this question.

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