Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 21512 - Portage changes terminal emulator title to xterm always.
Summary: Portage changes terminal emulator title to xterm always.
Status: RESOLVED DUPLICATE of bug 21430
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: High trivial (vote)
Assignee: Nicholas Jones (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-22 18:43 UTC by Chris Smith
Modified: 2011-10-30 22:21 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Smith 2003-05-22 18:43:09 UTC
When I run a portage command via Konsole (e.g. emerge kde), the progress of the build 
comes up in the title bar etc... (good idea, btw :), but when it finishes, it automatically changes 
the title back to "xterm". 
 
Perhaps have it save the current title, then restore it afterwards? 

Reproducible: Always
Steps to Reproduce:
1.emerge something in a terminal emulator 
2.when it finishes, title will be set to xterm 
3. 
Actual Results:  
title is set to xterm 

Expected Results:  
restored the title back to what it was. 

Portage 2.0.48 (default-x86-1.4, gcc-3.2.2, glibc-2.3.1-r2,2.3.1-r4) 
================================================================= 
System uname: 2.5.69-mm1 i686 AMD Duron(tm) processor 
GENTOO_MIRRORS="http://gazza.citylink.co.nz/gentoo/ http://gentoo.oregonstate.edu/ 
http://www.ibiblio.org/pub/Linux/distributions/gentoo" 
CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config /usr/kde/3/share/config 
/usr/X11R6/lib/X11/xkb /usr/kde/3.1/share/config /usr/share/config" 
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" 
PORTDIR="/usr/portage" 
DISTDIR="/usr/portage/distfiles" 
PKGDIR="/usr/portage/packages" 
PORTAGE_TMPDIR="/tmp" 
PORTDIR_OVERLAY="" 
USE="x86 oss 3dnow apm avi crypt cups encode gif jpeg libg++ libwww mikmod mmx mpeg 
ncurses nls pdflib png quicktime spell truetype xml2 xmms xv zlib gtkhtml gdbm berkdb slang 
readline arts aalib bonobo svga ggi java guile postgres X sdl gpm tcpd pam ssl perl python esd 
imlib oggvorbis gtk qt kde motif opengl mozilla acpi alsa artswrappersuid cdr directfb fbcon 
flash -gnome imap maildir -nas oav pnp samba scanner tcltk tiff usb wmf xinerama" 
COMPILER="gcc3" 
CHOST="i686-pc-linux-gnu" 
CFLAGS="-march=athlon -O2 -pipe -fomit-frame-pointer" 
CXXFLAGS="-march=athlon -O2 -pipe -fomit-frame-pointer" 
ACCEPT_KEYWORDS="x86" 
MAKEOPTS="-j2" 
AUTOCLEAN="yes" 
SYNC="rsync://rsync.gentoo.org/gentoo-portage" 
FEATURES="sandbox ccache"
Comment 1 Guy 2003-05-22 22:08:05 UTC
Data point:

The same thing happens with fluxbox as the WM using 'rxvt'. When the executed                 process 'eg - emerge sync' completes, the title changes to xterm.

BTW - Kudos to whoever thought up the idea to show 'emerge' progress in the title bar. Feature is very much appreciated. In fact, I'd rather live with returning to the wrong title than lose the new feature.

:-)
Comment 2 Matt Taylor 2003-05-23 21:14:19 UTC
When using aterm the title bars don't change.  If I use xterm, they change and go back to what they were before when the emerge finishes.  
Comment 3 Matt Taylor 2003-05-23 21:24:42 UTC
Oh, now that I think about it mine are going back to what they were cuz I have it set the working dir in it and it does it each time it draws the prompt.
Comment 4 Matt Taylor 2003-06-02 19:57:03 UTC
Titles change like they should with aterm now with portage-2.0.48-r1.
Comment 5 TGL 2003-06-17 02:15:01 UTC
> Perhaps have it save the current title, then restore it afterwards? 

As far as I know, there is no way to read the current xterm title :(

A possible workaround would be to use an environment variable to specify the default xterm title. In /usr/lib/python2.2/site-packages/output.py, change the 
xtermTitleReset() function to the following, so that if you have set 
$DEFAULT_TERM_TITLE in your environment, then emerge will use it when it exits:
---------------------------------------------------------------------
def xtermTitleReset():
	if havecolor and dotitles:
		if os.environ.has_key("DEFAULT_TERM_TITLE"):
			xtermTitle(os.environ["DEFAULT_TERM_TITLE"])
		else: 
			if os.environ.has_key("TERM"):
				xtermTitle(os.environ["TERM"])
---------------------------------------------------------------------

But anyway, as Matt said, the current behavior is easy to overide by adding the correct escape sequences in $PS1, so this workaround is not really needed.
(cf. http://www.tldp.org/HOWTO/mini/Xterm-Title-4.html#ss4.3 for an example)

Oh, and while we are talking about this, I think the xtermTitleReset() should 
not be used on exit if notitles is in the FEATURES. A 'if "notitles" not in 
portage.features:' should be added in emergeexit(), in /usr/lib/portage/bin/emerge.
Comment 6 SpanKY gentoo-dev 2003-07-09 12:44:33 UTC

*** This bug has been marked as a duplicate of 21430 ***
Comment 7 TGL 2003-08-24 08:22:41 UTC
Sorry SpanKY, but I think this bug is not a duplicate of #20430. It is about "setting the xterm title back to what it was before emerge", when notitles is NOT in features. #20430 was about "not modifying it at all" when notitles was in features. It's not the same issue, neither the same fix.