I change shell's foreground color with echo -ne '\e[1;31m'
command but when I execute ls
command the foreground color reverts back to the original previous color. This weird behavior doesn't occur when other commands are executed. I am clueless about the cause behind this.
Please write an explanation for this and also suggest the remedy. thanks
I am using UBUNTU 14.10.
EDIT- I have tried to remove the escape sequence for white color foreground by setting the alias for ls
as:
alias ls='ls --color=auto |sed -r 's/\x1b[37m]//''
But, this has a problem too, the ls
outputs all the directory names and filenames with single color ,i.e not with the default colors for all items.This is strange as I have removed just the [37m
which is the white foreground but it removes all the colors.
ls
which isls --colour=auto
? There's also an alias for grep with an auto colour option, so maybe grep would exhibit the same behaviour. You could always try unsetting the ls alias to see if it helps.ls --color=auto
line does it but it removes the actual colored output of ls command .ls
outputs the directory name and file name all with the same color .