bash: Change the terminal title when TERM=screen
authorMatthijs Kooijman <matthijs@stdin.nl>
Wed, 29 Feb 2012 13:23:47 +0000 (14:23 +0100)
committerMatthijs Kooijman <matthijs@stdin.nl>
Wed, 29 Feb 2012 15:13:39 +0000 (16:13 +0100)
etc/skel/.bashrc

index 17c7b51a761db3d7d11753f124fe98da911bf1c6..ab43aef2bc24cf8dfc2dad22297c945dec90dbec 100644 (file)
@@ -55,11 +55,15 @@ else
 fi
 unset color_prompt force_color_prompt
 
-# If this is an xterm set the title to user@host:dir
+# If this is an xterm or screen set the title to user@host:dir
 case "$TERM" in
 xterm*|rxvt*)
     PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
     ;;
+screen)
+    # Only show the hostname in screen, since there is less space
+    PS1="\[\ek${debian_chroot:+($debian_chroot)}\u@\h:\e\134\]$PS1"
+    ;;
 *)
     ;;
 esac