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.
Created attachment 1834 [details, diff] profile.diff Patch against /etc/profile
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).
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
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
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.
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.
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.
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. ;-)
*** Bug 4414 has been marked as a duplicate of this bug. ***
Eterm works as well