diff options
-rw-r--r-- | etc/shrc | 88 |
1 files changed, 79 insertions, 9 deletions
@@ -23,20 +23,90 @@ case "$-" in *i*) *ksh,*,/*) PS1=$PS1']0;$PWD' ;; *bash,screen,*) - PROMPT_COMMAND='safetitle "${PWD/#\/home\/john/\~}"' - cmdtitle() { - case "$BASH_COMMAND" in - safetitle*) ;; - *) safetitle "$BASH_COMMAND" ;; - esac - } ;; + PROMPT_COMMAND='safetitle "${PWD/#\/home\/john/\~}"' ;; *bash,*,/*) - PS1='\[\033]0;\w\007\]'$PS1 - cmdtitle() { echo -ne "\033]0;$BASH_COMMAND\007"; } ;; + PS1='\[\033]0;\w\007\]'$PS1 ;; *) ;; 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 |