Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 4232 - Patch to /etc/profile to update the window title of xterm (and alike) with the prompt
Summary: Patch to /etc/profile to update the window title of xterm (and alike) with th...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High enhancement (vote)
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
: 4414 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-06-27 07:30 UTC by José Fonseca
Modified: 2015-06-07 19:52 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
profile.diff (profile.diff,935 bytes, patch)
2002-06-27 07:31 UTC, José Fonseca
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description José Fonseca 2002-06-27 07:30:23 UTC
Attached below is a patch to /etc/profile that makes bash update the xterm (and
other terminal emulators) window title with the user and path. It was adapted
from RedHat and changed to mimic the default prompt that Gentoo uses.

Note that even if one can argue that he doesn't want xterm window title like
this, the fact is that there are several console applications that _do_ change
the window title for themselves. The failure of updating the window title when
bash regains control of the terminal means that the garbage in the window title
will remain _forever_ or until other application replaces with their own window
title garbage and so on... For this I think that this new default would be much
more reasonable, not to mention the fact that having the username and the path
on the windows _really_ helps in distiguishing between several open xterms windows.
Comment 1 José Fonseca 2002-06-27 07:31:53 UTC
Created attachment 1834 [details, diff]
profile.diff

Patch against /etc/profile
Comment 2 Martin Schlemmer (RETIRED) gentoo-dev 2002-06-28 15:21:38 UTC
I think this should rather go into the Gentoo tips and tricks (or is it now
the FAQ).  Contact George I think, to learn how to submit 
george@gentoo.org).
Comment 3 José Fonseca 2002-06-28 15:48:13 UTC
hmm... I don't see what's so special about setting the PROMPT_COMMAND variable
in /etc/profile to show the user and path on the terminal window's title that
qualifies it as a "tip & trick" while (on the same file) one already can find
the PS1 variable being set to show the user and path (and with lots of colors
too!)... well, it's not for me to decide it.

Anyway, George (who I noticed was added to the CC): if you think that this is
material for the FAQ (or whatever it's called), please feel free to include it
(or perhaps just a reference to this bug). If you need any further assistance,
please say so.

Regards,

Jos
Comment 4 José Fonseca 2002-06-28 15:48:13 UTC
hmm... I don't see what's so special about setting the PROMPT_COMMAND variable
in /etc/profile to show the user and path on the terminal window's title that
qualifies it as a "tip & trick" while (on the same file) one already can find
the PS1 variable being set to show the user and path (and with lots of colors
too!)... well, it's not for me to decide it.

Anyway, George (who I noticed was added to the CC): if you think that this is
material for the FAQ (or whatever it's called), please feel free to include it
(or perhaps just a reference to this bug). If you need any further assistance,
please say so.

Regards,

José Fonseca
Comment 5 Martin Schlemmer (RETIRED) gentoo-dev 2002-06-29 17:03:37 UTC
Well, I guess you could argue that it sort of increased security .. the user
know immediately if he is logged in as root or not.  But I am not going to
push that "argument" ;-)

Main thing basically is that to keep something manageble, simple is most
of the times the best way of doing it.  Yes, it is only (?) a sixteen liner,
but if we add this to the default, we will have to add the following 24 liner
as well.

The stuff in baselayout should anyhow just contain a good basic setup.  And
there should be no reason for you not to add it locally ... with CONFIG_PROTECT
you can have a custom /etc/profile without worrying that it will be replaced
at any time.  Or maybe add it to /etc/skel/ could be another reason a user
could do it locally.

Why I suggested for George to add, is that there will be some user who would
like to have it in thier own setups ... it should thus not get lost like many
nice features/customizations I have misplaced myself.
Comment 6 José Fonseca 2002-06-29 17:38:18 UTC
I just want to add that as far as I'm concerned my problem is solved. I
personally wanted the behavior that RedHat Linux has by _default_. In fact the
reason I noticed [it wasn't a bug in xterm/gnome-terminal] was that when I ssh'd
to my workstation [with RHL] my windows terminal title changed!! (and never
changed back BTW, as I told above...)

Of course that Gentoo can have whatever defaults policy its developers think
it's more appropriate. Of course I don't agree with them (what is a "good basic
setup" depends alot of whom you have in mind...) but it's not my lost
nevertheless: I just wanted to facilitate that Gentoo had this particular
feature by default, in the hope that it would avoid the hassle that first-time
Gentoo users had to figure this by themselves, therefore adding more value to
Gentoo.

I have made my duty. Closing this bug now.
Comment 7 Martin Schlemmer (RETIRED) gentoo-dev 2002-06-29 20:18:09 UTC
Ok, I talked to the other guys, and we decided that /etc/skel/.bashrc is a more
suited place.  Dont understand me wrong, I did not want to throw away your
changes, but I dont want /etc/profile to get out of hand as well.

Anyhow, fixed on CVS.
Comment 8 José Fonseca 2002-06-30 07:09:44 UTC
I've checked the /etc/skel/.bashrc in CVS and I must agree that it's a much
better place than /etc/profile.

In fact I'll move that stuff to my personal .bashrc since it's much easier to
keep track of ~/.bashrc and reuse it later than something that lives on /etc. ;-) 
Comment 9 Martin Schlemmer (RETIRED) gentoo-dev 2002-07-02 14:45:06 UTC
*** Bug 4414 has been marked as a duplicate of this bug. ***
Comment 10 Seemant Kulleen (RETIRED) gentoo-dev 2002-07-02 15:00:04 UTC
Eterm works as well