aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--etc/shrc79
-rw-r--r--home/john/.bash_profile81
2 files changed, 81 insertions, 79 deletions
diff --git a/etc/shrc b/etc/shrc
index e637857..a8e675f 100644
--- a/etc/shrc
+++ b/etc/shrc
@@ -22,7 +22,7 @@ case "$-" in *i*)
PS1=$PS1'$(safetitle "$PWD")' ;;
*ksh,*,/*)
PS1=$PS1']0;$PWD' ;;
- *bash,screen,*)
+ *bash,screen,/*)
PROMPT_COMMAND='safetitle "${PWD/#\/home\/john/\~}"' ;;
*bash,*,/*)
PS1='\[\033]0;\w\007\]'$PS1 ;;
@@ -30,83 +30,6 @@ case "$-" in *i*)
;;
esac
- case "$0" in *bash)
- cmdtitle() {
- cmd=${BASH_COMMAND#builtin }
- cmd=${cmd#doas }
- case "${cmd%% *}" in
- safetitle) return ;;
- screen) return ;;
- ls) return ;;
- ll) return ;;
- mv) return ;;
- rm) return ;;
- :) return ;;
- .) return ;;
- source) return ;;
- alias) return ;;
- bg) return ;;
- bind) return ;;
- break) return ;;
- builtin) return ;;
- caller) return ;;
- cd) return ;;
- command) return ;;
- compgen) return ;;
- complete) return ;;
- compopt) return ;;
- continue) return ;;
- declare) return ;;
- typeset) return ;;
- disown) return ;;
- echo) return ;;
- enable) return ;;
- eval) return ;;
- exec) return ;;
- exit) return ;;
- export) return ;;
- fc) return ;;
- fc) return ;;
- fg) return ;;
- getopts) return ;;
- hash) return ;;
- help) return ;;
- history) return ;;
- jobs) return ;;
- kill) return ;;
- let) return ;;
- local) return ;;
- mapfile) return ;;
- readarray) return ;;
- popd) return ;;
- printf) return ;;
- pushd) return ;;
- pwd) return ;;
- read) return ;;
- readonly) return ;;
- return) return ;;
- set) return ;;
- shift) return ;;
- shopt) return ;;
- suspend) return ;;
- test) return ;;
- [) return ;;
- trap) return ;;
- type) return ;;
- ulimit) return ;;
- umask) return ;;
- unalias) return ;;
- unset) return ;;
- wait) return ;;
- *) ;;
- esac
- eval 'pwd=${PWD/\/home\/john/\~}'
- [[ $TERM = screen ]] &&
- safetitle "$BASH_COMMAND ($pwd)" ||
- echo -ne "\033]0;$BASH_COMMAND ($pwd)\007"
- }
- ;; esac
-
# This file is used by shells that might not support
# set -o tabcomplete, so check before trying to use it.
( set -o tabcomplete 2>/dev/null ) && set -o tabcomplete
diff --git a/home/john/.bash_profile b/home/john/.bash_profile
index de6c2ee..938adb7 100644
--- a/home/john/.bash_profile
+++ b/home/john/.bash_profile
@@ -1,3 +1,82 @@
. $HOME/.profile
. $HOME/.shrc
-trap cmdtitle DEBUG
+
+case "$XTERM_SHELL" in
+ /*) trap cmdtitle DEBUG ;;
+ *) ;;
+esac
+
+cmdtitle() {
+ cmd=${BASH_COMMAND#builtin }
+ cmd=${cmd#doas }
+ case "${cmd%% *}" in
+ safetitle) return ;;
+ screen) return ;;
+ ls) return ;;
+ ll) return ;;
+ mv) return ;;
+ rm) return ;;
+ :) return ;;
+ .) return ;;
+ source) return ;;
+ alias) return ;;
+ bg) return ;;
+ bind) return ;;
+ break) return ;;
+ builtin) return ;;
+ caller) return ;;
+ cd) return ;;
+ command) return ;;
+ compgen) return ;;
+ complete) return ;;
+ compopt) return ;;
+ continue) return ;;
+ declare) return ;;
+ typeset) return ;;
+ disown) return ;;
+ echo) return ;;
+ enable) return ;;
+ eval) return ;;
+ exec) return ;;
+ exit) return ;;
+ export) return ;;
+ fc) return ;;
+ fc) return ;;
+ fg) return ;;
+ getopts) return ;;
+ hash) return ;;
+ help) return ;;
+ history) return ;;
+ jobs) return ;;
+ kill) return ;;
+ let) return ;;
+ local) return ;;
+ mapfile) return ;;
+ readarray) return ;;
+ popd) return ;;
+ printf) return ;;
+ pushd) return ;;
+ pwd) return ;;
+ read) return ;;
+ readonly) return ;;
+ return) return ;;
+ set) return ;;
+ shift) return ;;
+ shopt) return ;;
+ suspend) return ;;
+ test) return ;;
+ [) return ;;
+ trap) return ;;
+ type) return ;;
+ ulimit) return ;;
+ umask) return ;;
+ unalias) return ;;
+ unset) return ;;
+ wait) return ;;
+ *) ;;
+ esac
+ pwd=${PWD/\/home\/john/\~}
+ [[ $TERM = screen ]] &&
+ safetitle "$BASH_COMMAND ($pwd)" ||
+ echo -ne "\033]0;$BASH_COMMAND ($pwd)\007"
+}