aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2012-02-25 21:34:43 +1300
committerTom Ryder <tom@sanctum.geek.nz>2012-02-25 21:34:43 +1300
commit8ed7fc329add75a178b916bdcb80e684fa8ea79f (patch)
tree819d7e8fee59bf00fc6db41fc4ee59d5f1ffbfdd
parentRemoved screen title-updating prompt. (diff)
downloaddotfiles-8ed7fc329add75a178b916bdcb80e684fa8ea79f.tar.gz
dotfiles-8ed7fc329add75a178b916bdcb80e684fa8ea79f.zip
Change screen window title with PROMPT_COMMAND.
Seems to work better than adding it as part of the prompt, so guess I can't complain.
-rw-r--r--bash/bashrc7
1 files changed, 6 insertions, 1 deletions
diff --git a/bash/bashrc b/bash/bashrc
index 20960eaa..878a2fa7 100644
--- a/bash/bashrc
+++ b/bash/bashrc
@@ -15,7 +15,7 @@ HISTTIMEFORMAT='%F %T '
HISTIGNORE='ls:ls -l:ls -la:fg:bg:jobs:history'
# Add all commands to the history immediately.
-PROMPT_COMMAND='history -a; history -n'
+PROMPT_COMMAND='history -a;history -n'
# Don't check for mail all the time, it's irritating.
unset MAILCHECK
@@ -73,5 +73,10 @@ case "$TERM" in
PS1="\[\e]0;\h\a\]"${PS1}
TERM=xterm-256color
;;
+
+ # Set screen window title.
+ screen*)
+ PROMPT_COMMAND="printf '\033k$(hostname)\033\\';"${PROMPT_COMMAND}
+ ;;
esac