xterm title HOSTNAME support, bug #390699
authorZac Medico <zmedico@gentoo.org>
Wed, 16 Nov 2011 18:24:34 +0000 (10:24 -0800)
committerZac Medico <zmedico@gentoo.org>
Wed, 16 Nov 2011 18:24:34 +0000 (10:24 -0800)
pym/_emerge/JobStatusDisplay.py

index 1949232e7a04d6e57b83d20ddfe6d02c06077f01..877a0c96363793ffff982ebe75a1aa4db2dd3867 100644 (file)
@@ -289,4 +289,11 @@ class JobStatusDisplay(object):
                        self._update(color_output.getvalue())
 
                if self.xterm_titles:
-                       xtermTitle(" ".join(plain_output.split()))
+                       # If the HOSTNAME variable is exported, include it
+                       # in the xterm title, just like emergelog() does.
+                       # See bug #390699.
+                       title_str = " ".join(plain_output.split())
+                       hostname = os.environ.get("HOSTNAME")
+                       if hostname is not None:
+                               title_str = "%s: %s" % (hostname, title_str)
+                       xtermTitle(title_str)