ls should not color output when --color=auto is used in environment TERM
From:
Lenny Domnitser
Subject:
ls should not color output when --color=auto is used in environment TERM=dumb
Date:
Tue, 12 Jun 2007 19:29:24 -0400
Some terminals such as M-x shell in Emacs don't understand color
output, and set the TERM environment variable to "dumb". ls should
check that variable when turning on color from --color=auto.
For a use case of TERM=dumb which works around ls --color=auto, here's
a snippet from /etc/skel/.bashrc in a Debian or Ubuntu system.
# enable color support of ls and also add handy aliases
if [ "$TERM" != "dumb" ]; then
eval "`dircolors -b`"
alias ls='ls --color=auto'
#alias dir='ls --color=auto --format=vertical'
#alias vdir='ls --color=auto --format=long'
fi
If this bug is considered in scope for ls, I can probably code up a
patch pretty soon.
-Lenny