From 76a2be361dc47caf4062a50a0b24d32cbe40b3c6 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Tue, 16 Nov 2021 09:35:20 +0100 Subject: bashrc: set the xterm/rxvt terminal window title --- bash/bashrc | 9 +++++++++ 1 file changed, 9 insertions(+) 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" -- cgit v1.2.3