Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 19205 - The "-title" parameter for xterm and gnome-terminal doesn't work
The "-title" parameter for xterm and gnome-terminal doesn't work
Product: Red Hat Linux
Classification: Retired
Component: setup (Show other bugs)
i686 Linux
low Severity low
: ---
: ---
Assigned To: Bill Nottingham
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2000-10-16 17:09 EDT by danmcnaul
Modified: 2014-03-16 22:16 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-05-21 15:09:09 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description danmcnaul 2000-10-16 17:09:05 EDT
The "-title" command line parameter for xterm and/or gnome-terminal does 
not work.  The title provided does appear momentarily on the new window, 
but is quickly replaced with "userid@machine dirname".  The title is 
displayed correctly when one exports "TERM=vt220", but that is the only 
terminal type I found that it worked for.  The same bug exists for both "-
t" and "-title".
Comment 1 Alan Cox 2000-10-16 19:37:05 EDT
The default prompt sets the titlebar too. Set the PROMPT_COMMAND environment
variable differently
Comment 2 danmcnaul 2000-10-17 14:27:18 EDT
There is no PROMPT_COMMAND environment variable set on my system to conflict 
with the -title parameter.  This IS a bug.  The -title should set the title bar 
as stated in the man pages.  As it did in past releases.

Comment 3 Simon Hill 2000-10-30 18:28:43 EST
I agree with Dan. I have scripts that put specific titles on specific xterms
running specific programs which I use in my work. Now they are all overidden
with the 'user@hostname pwd' and I cannot distinguish them at a glance on the
KDE taskbar, because now they all show the same user name and part of the

It is all very well to add a new option and environment variable, but the
DEFAULT BEHAVIOR when the variable is not set (which it isn't) SHOULD NOT
CHANGE. I do not know where to find documentation on this variable or how to set
it to get the old behavior back, and I SHOULDN'T HAVE TO. Meanwhile, my work
patterns are disrupted and my productivity is decreased....
Comment 4 Simon Hill 2000-10-30 18:36:48 EST
Oh, I notice that this bug is for RH7.0. Actually the problem began in RH6.2.
Also, please excuse my caps - I don't mean to shout - it's just easier than
italics or bold ;-)
Comment 5 Mike A. Harris 2001-04-02 13:40:46 EDT
I just reproduced this and it *is* extremely annoying, I agree.
I tracked the problem down to /etc/bashrc, it contains code:

if [ "$PS1" ]; then
    if [ -x /usr/bin/tput ]; then
      if [ "x`tput kbs`" != "x" ]; then # We can't do this with "dumb" terminal
        stty erase `tput kbs`
    case $TERM in
	    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'

This is totally broken, and should not be forced upon a user.  This code
needs to be removed, moved to the skeleton files so a user can disable it
if they want, or implemented in another way.  I recommend doing away with
it myself, but that decision is ultimately up to the bash package
maintainer.  Changing packages..
Comment 6 Mike A. Harris 2001-04-02 13:50:25 EDT
Bero, can you look into this and see if there is an obvious way to fix it?
For now the obvious workaround is editing ~/.bashrc and stopping it from
sourcing /etc/bashrc

I'm not sure how you'd go about detecting wether or not xterm has been
given a title argument.  If it cannot be fixed easily, the best way is
likely to change the default behaviour of xterm to display

Let me know if you think this is best, and I'll hack on xterm.
Comment 7 Mike A. Harris 2001-04-02 14:49:21 EDT
I just looked into the xterm source and while I could hack this
into xterm for the default window title, once it is set, it will stay
like that so it isn't very useful because the path does not bet updated
when you cd.

So..  I think the code should be moved to the .bashrc skeleton files
instead of /etc/bashrc, and logic put in to determine if xterm is being
called with the title arg.

I'm going to go hack for a bit.
Comment 8 Mike A. Harris 2001-04-02 15:13:17 EDT
I played around with it a bit and here is some crud I came up with.  As
is, it does not quite work, but is close, however it would only work with
xterm, and other similar apps that take -title, -T as args to set the title.

            # Was xterm given the -title or -T args?
            cat /proc/$PPID/cmdline |grep "\-\(title\|T\)" >& /dev/null
            [ $? ] || {
             PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'

It might be possible to tweak it into working, but it is nothing more than a hack.
Comment 9 Bernhard Rosenkraenzer 2001-05-21 15:09:05 EDT
bashrc lives in setup these days...
The current version has some hooks you might be interested in, though:
If you create
they will override the default PROMPT_COMMAND.

Comment 10 Bill Nottingham 2001-05-21 15:20:18 EDT
Also, you can override it in your ~/.bashrc.

Note You need to log in before you can comment on or make changes to this bug.