~mdw
/
profile
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
dot/Xdefaults.pterm: Fiddle with `pterm' colours.
[profile]
/
dot
/
shell-rc
diff --git
a/dot/shell-rc
b/dot/shell-rc
index
772625b
..
5251e98
100644
(file)
--- a/
dot/shell-rc
+++ b/
dot/shell-rc
@@
-241,17
+241,23
@@
alias abcl="rlwrap abcl --noinform"
###--------------------------------------------------------------------------
### Colour output.
###--------------------------------------------------------------------------
### Colour output.
+mdw_colour_p () {
+ if ! [ -t 1 ]; then return 1; fi
+ case $TERM in dumb) return 1 ;; esac
+ return 0
+}
+
## Arrange for `ls' output to be in colour.
unalias ls 2>/dev/null || :
ls () {
## Arrange for `ls' output to be in colour.
unalias ls 2>/dev/null || :
ls () {
- if
[ -t 1 ]; then command ls $LS_OPTIONS ${LS_COLORS+--color=auto
} "$@"
+ if
mdw_colour_p; then command ls $LS_OPTIONS ${LS_COLORS+--color=always
} "$@"
else command ls "$@"; fi
}
## Arrange for `grep' output to be in colour.
greplike () {
local grep=$1; shift
else command ls "$@"; fi
}
## Arrange for `grep' output to be in colour.
greplike () {
local grep=$1; shift
- if
[ -t 1 ]
; then
+ if
mdw_colour_p
; then
command $grep ${GREP_COLORS+--color=always} "$@" | mdw-pager
else
command $grep "$@"
command $grep ${GREP_COLORS+--color=always} "$@" | mdw-pager
else
command $grep "$@"
@@
-265,7
+271,7
@@
alias zgrep="greplike zgrep"
## Arrange for `diff' output to be in colour.
difflike () {
local diff=$1; shift
## Arrange for `diff' output to be in colour.
difflike () {
local diff=$1; shift
- if
[ -t 1 ]
; then
+ if
mdw_colour_p
; then
command $diff \
${DIFF_COLORS+--color=always} \
${DIFF_COLORS+--palette="$DIFF_COLORS"} \
command $diff \
${DIFF_COLORS+--color=always} \
${DIFF_COLORS+--palette="$DIFF_COLORS"} \