summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-11-16 09:35:20 +0100
committerAnton Khirnov <anton@khirnov.net>2021-11-16 09:35:20 +0100
commit76a2be361dc47caf4062a50a0b24d32cbe40b3c6 (patch)
tree8ecb7557cdff24fdd008567333d10917d8f45f5e
parentd032ee43893eb04ec752354167bd262cf8430b5b (diff)
bashrc: set the xterm/rxvt terminal window title
-rw-r--r--bash/bashrc9
1 files changed, 9 insertions, 0 deletions
diff --git a/bash/bashrc b/bash/bashrc
index 8d7fb8b..b0f0779 100644
--- a/bash/bashrc
+++ b/bash/bashrc
@@ -80,5 +80,14 @@ t() { __ht "tail -32" $@; }
. ~/.config/bash/prompt
PS1=$(__prompt_func)
+# set the terminal window title
+case "$TERM" in
+xterm*|rxvt*)
+ PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
+ ;;
+*)
+ ;;
+esac
+
# source the machine-local configuration
[ -r "$HOME/.config/bash/bashrc_local.bash" ] && . "$HOME/.config/bash/bashrc_local.bash"