~mdw
/
profile
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
dot/shell-rc: Force the policy on `ls', like it is in `diff' and `grep'.
[profile]
/
dot
/
shell-rc
diff --git
a/dot/shell-rc
b/dot/shell-rc
index
b65f63e
..
5251e98
100644
(file)
--- a/
dot/shell-rc
+++ b/
dot/shell-rc
@@
-175,7
+175,7
@@
__mdw_set_prompt () {
__mdw_xterm_settitle () {
printf >/dev/tty \
__mdw_xterm_settitle () {
printf >/dev/tty \
- "
\e
]
2
;%s@%s:%s – %s
\e
\\" \
+ "
\e
]
0
;%s@%s:%s – %s
\e
\\" \
"$__mdw_user" "$__mdw_host$__mdw_hqual" "$PWD" \
"$1"
}
"$__mdw_user" "$__mdw_host$__mdw_hqual" "$PWD" \
"$1"
}
@@
-241,22
+241,23
@@
alias abcl="rlwrap abcl --noinform"
###--------------------------------------------------------------------------
### Colour output.
###--------------------------------------------------------------------------
### 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
+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 () {
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.
else command ls "$@"; fi
}
## 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
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 "$@"
@@
-268,10
+269,9
@@
alias fgrep="greplike fgrep"
alias zgrep="greplike zgrep"
## Arrange for `diff' output to be in colour.
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
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"} \
@@
-473,6
+473,13
@@
case $(id -u) in
;;
esac
;;
esac
+## Install wakeup machinery for long-running programs.
+case ${DISPLAY+t},${WINDOWID+t},${__mdw_precmd_hook+t},${__mdw_preexec_hook+t} in
+ t,t,t,t)
+ if [ -t 0 ] && __mdw_programp notify-send; then . $HOME/bin/wakey.sh; fi
+ ;;
+esac
+
## Run any local hooks.
__mdw_source_if_exists "$HOME/.shell-local"
## Run any local hooks.
__mdw_source_if_exists "$HOME/.shell-local"