Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 208695

Summary: app-shells/bash - bashrc has bad code setting app-misc/screen title
Product: Gentoo Linux Reporter: Leonid Evdokimov <leon+gentoo>
Component: New packagesAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: trivial CC: dschridde+gentoobugs, jer, swegener
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=359389
https://bugs.gentoo.org/show_bug.cgi?id=223641
https://bugs.gentoo.org/show_bug.cgi?id=550104
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: bashrc patch

Description Leonid Evdokimov 2008-02-03 06:52:56 UTC
bashrc uses <esc>_ as «start» of screen title, <esc>k should be used according to man screen/TITLES

BUG #75670 also mentions that screen $TERM should be checked as "screen*", not as "screen"

Reproducible: Always

Steps to Reproduce:
1. start screen
2. C-a "
3. Look at title :)

Actual Results:  
title of the window is "bash"

Expected Results:  
title should look like user@host:~

$ diff -u /etc/bash/bashrc{.orig,}
--- /etc/bash/bashrc.orig       2008-02-03 12:36:19.000000000 +0600
+++ /etc/bash/bashrc    2008-02-03 12:43:11.000000000 +0600
@@ -28,8 +28,8 @@
        xterm*|rxvt*|Eterm|aterm|kterm|gnome*)
                PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\007"'
                ;;
-       screen)
-               PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\033\\"'
+       screen*)
+               PROMPT_COMMAND='echo -ne "\033k${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\033\\"'
                ;;
 esac
Comment 1 Leonid Evdokimov 2008-08-17 07:44:45 UTC
Created attachment 163101 [details, diff]
bashrc patch

Is there anything wrong with this trivial patch?
Comment 2 SpanKY gentoo-dev 2009-01-10 12:32:20 UTC
i dont particularly care ... if the screen maintainer says it's ok, then it may be committed
Comment 3 Sven Wegener gentoo-dev 2009-01-11 14:53:59 UTC
I'm totally against dynamically changing the screen window title. The screen window title is actually a name for a window and not something where auxiliary information can be shown. It reflects how the user names his/her screen windows and it can be used to jump to windows by name. Hence it should be constant and never changed by an application.

The hardstatus, which is what we currently set, is the correct way for such information. For xterm we also set the hardstatus and xterm propagates it up as the X window title.
Comment 4 Leonid Evdokimov 2009-01-11 15:06:13 UTC
I agree, hardstatus may be better place than window name.
Maybe, the bug should be resolved as `invalid'.
Comment 5 SpanKY gentoo-dev 2009-01-11 17:07:00 UTC
i think that's what Sven was going for :)
Comment 6 Dennis Schridde 2011-01-01 10:36:26 UTC
This should probably be documented, or even configurable via useflag.
Comment 7 SpanKY gentoo-dev 2015-02-24 20:56:43 UTC
looks like this was done via bug 359389

http://sources.gentoo.org/app-shells/bash/files/bashrc?r1=1.21&r2=1.22