From: Mark Wooding Date: Sun, 12 May 2024 23:36:50 +0000 (+0100) Subject: dot/profile, dot/shell-rc: Move colour settings into profile. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/profile/commitdiff_plain/8af9950cf8f948b36f023585242ac2e4f58107ac dot/profile, dot/shell-rc: Move colour settings into profile. Now the actual colour definitions are set in the profile, and the decision to apply them is in the shell `rc' file. --- diff --git a/dot/profile b/dot/profile index 93c5421..f8d4dc9 100644 --- a/dot/profile +++ b/dot/profile @@ -308,6 +308,12 @@ PS_PERSONALITY=gnu; export PS_PERSONALITY DEB_BUILD_OPTIONS="parallel=$(mdw-conf make-parallel 4)" export DEB_BUILD_OPTIONS +## Turn on useful colouring. +if __mdw_programp dircolors; then eval $(dircolors -b "$HOME/.dircolors") +else unset LS_COLORS; fi +export GREP_COLORS="mt=01;31:ms=01;31:mc=031;31:fn=36:ln=36:bn=36:se=34" +export DIFF_COLORS="hd=1:ln=36:ad=32:de=31" + ## Turn off angry fruit salad error messages from things. DPKG_COLORS=never; export DPKG_COLORS GCC_COLORS=; export GCC_COLORS diff --git a/dot/shell-rc b/dot/shell-rc index 33403cb..772625b 100644 --- a/dot/shell-rc +++ b/dot/shell-rc @@ -242,9 +242,6 @@ alias abcl="rlwrap abcl --noinform" ### Colour output. ## Arrange for `ls' output to be in colour. -if __mdw_programp dircolors; then eval $(dircolors -b "$HOME/.dircolors") -else unset LS_COLORS; fi - unalias ls 2>/dev/null || : ls () { if [ -t 1 ]; then command ls $LS_OPTIONS ${LS_COLORS+--color=auto} "$@" @@ -252,8 +249,6 @@ ls () { } ## Arrange for `grep' output to be in colour. -export GREP_COLORS="mt=01;31:ms=01;31:mc=031;31:fn=36:ln=36:bn=36:se=34" - greplike () { local grep=$1; shift if [ -t 1 ]; then @@ -268,7 +263,6 @@ alias fgrep="greplike fgrep" alias zgrep="greplike zgrep" ## Arrange for `diff' output to be in colour. -export DIFF_COLORS="hd=1:ln=36:ad=32:de=31" difflike () { local diff=$1; shift if [ -t 1 ]; then