From 9cb4ae0650441c844ec4408578ad36b1028cb4a7 Mon Sep 17 00:00:00 2001 From: wxf Date: Fri, 1 Jan 2016 16:29:26 +0800 Subject: [PATCH] add host info in titlebar --- themes/morris/morris.theme.bash | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/themes/morris/morris.theme.bash b/themes/morris/morris.theme.bash index 27571bde..da51e55a 100644 --- a/themes/morris/morris.theme.bash +++ b/themes/morris/morris.theme.bash @@ -4,11 +4,14 @@ # added TITLEBAR for updating the tab and window titles with the pwd case $TERM in xterm*) - TITLEBAR="\[\033]0;\w\007\]" - ;; + TITLEBAR=$(printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}") + ;; + screen) + TITLEBAR=$(printf "\033]0;%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}") + ;; *) - TITLEBAR="" - ;; + TITLEBAR="" + ;; esac function prompt_command() {