aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2015-06-19 15:44:23 +1200
committerTom Ryder <tom@sanctum.geek.nz>2015-06-19 15:44:23 +1200
commite90c03ab1a49a2acde7d7d66edd54acbdd1c50f2 (patch)
tree444752417bc74c895c3a1ea4de3f63c29455656d /bash/bashrc.d
parentmake(1) wrapper deals with *_COLORS vars (diff)
downloaddotfiles-e90c03ab1a49a2acde7d7d66edd54acbdd1c50f2.tar.gz
dotfiles-e90c03ab1a49a2acde7d7d66edd54acbdd1c50f2.zip
Kid gloves only needed for GCC_COLORS
Diffstat (limited to 'bash/bashrc.d')
-rw-r--r--bash/bashrc.d/make.bash13
1 files changed, 6 insertions, 7 deletions
diff --git a/bash/bashrc.d/make.bash b/bash/bashrc.d/make.bash
index 63ffa3f0..397ba944 100644
--- a/bash/bashrc.d/make.bash
+++ b/bash/bashrc.d/make.bash
@@ -1,6 +1,8 @@
-# Unset all my *_COLORS vars when invoking make(1) if terminal doesn't have
-# color; I have to do this because my wrapper functions are ignored by the
-# /bin/sh fork make(1) does
+# Unset my GCC_COLORS vars when invoking make(1) if terminal doesn't have
+# color; I have to do this because my wrapper function is ignored by the
+# /bin/sh fork make(1) does, and gcc(1) always uses colors if the variable is
+# set, as opposed to ls(1) and grep(1) which only do it if the --color option
+# is specified appropriately.
make() {
local -i colors
colors=$( {
@@ -9,10 +11,7 @@ make() {
if ((colors >= 8)) ; then
command make "$@"
else
- (
- unset -v GCC_COLORS GREP_COLORS LS_COLORS
- command make "$@"
- )
+ ( unset -v GCC_COLORS ; command make "$@" )
fi
}