Package: bash
Version: 4.2+dfsg-1
Followup-For: Bug #358965
Control: retitle -1 bash: Please support setting terminal title for screen

This request still applies to current versions of bash.
/etc/skel/.bashrc has changed, though; it no longer uses PROMPT_COMMAND.
I've attached a patch to debian/skel.bashrc in the source package, which
addresses this request.

Note that the number of backslashes in the prompt is quite intentional
(screen's control sequence ends in \\, which needs doubling to escape it
within a double-quoted string), as is the ;& fall-through at the end of
the screen case (the xterm control sequence also sets screen's
hardstatus, which sets the title of the xterm or similar that screen
runs in).

- Josh Triplett
--- a/debian/skel.bashrc	2012-07-01 05:45:23.000000000 -0700
+++ b/debian/skel.bashrc	2013-07-06 15:38:39.717449740 -0700
@@ -63,13 +63,14 @@
 fi
 unset color_prompt force_color_prompt
 
-# If this is an xterm set the title to user@host:dir
+# Set the terminal title on supported terminals
 case "$TERM" in
+screen*)
+    PS1="\[\ek${debian_chroot:+($debian_chroot)}\u@\h:\w\e\\\\\]$PS1"
+    ;&
 xterm*|rxvt*)
     PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
     ;;
-*)
-    ;;
 esac
 
 # enable color support of ls and also add handy aliases

Reply via email to