add host info in titlebar

pull/635/head
wxf 2016-01-01 16:29:26 +08:00
parent 56fdb6333c
commit 9cb4ae0650
1 changed files with 7 additions and 4 deletions

View File

@ -4,11 +4,14 @@
# added TITLEBAR for updating the tab and window titles with the pwd # added TITLEBAR for updating the tab and window titles with the pwd
case $TERM in case $TERM in
xterm*) 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 esac
function prompt_command() { function prompt_command() {