diff options
author | John Ankarstr\xf6m <john@ankarstrom.se> | 2021-06-05 20:01:52 +0200 |
---|---|---|
committer | John Ankarstr\xf6m <john@ankarstrom.se> | 2021-06-05 20:08:12 +0200 |
commit | ff66f69a3eb50834965dedb41ecd7cec13a3160d (patch) | |
tree | b22ecddc4e6d47346f38cb9fe863c4b892d201cb /home | |
parent | ff48d0ee694bce4e945c5839faa2f70fc4ca5729 (diff) | |
download | lbsd-ff66f69a3eb50834965dedb41ecd7cec13a3160d.tar.gz |
shrc: Fix process-based window titles in bash
Diffstat (limited to 'home')
-rw-r--r-- | home/john/.bash_profile | 81 |
1 files changed, 80 insertions, 1 deletions
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" +} |