in File: /usr/lib/portage/pym/output.py in Function: def xtermTitle(mystr): 1. Bug: Screen appends stuff to it's TERM Env-Var (i.e. "screen.linux"), meaning that matching myt with only "screen" won't work. 2. Improvement: Why not display the emerge-status in the Screen-Window-Title (previoulsy known as "aka") as well, so we would have a progress-indicator even without X. Reproducible: Always Steps to Reproduce: 1. start screen 2. emerge something Actual Results: everythink ok, but no <some X-Term>-Title was set Expected Results: see Details proposed patch: +++ /usr/lib/portage/pym/output.py --- /var/tmp/portage/portage-2.0.51-r3/work/portage-2.0.51-r3/pym/output.py @@ -37,13 +37,9 @@ if havecolor and dotitles and os.environ.has_key("TERM"): myt=os.environ["TERM"] legal_terms = ["xterm","Eterm","aterm","rxvt","screen","kterm","rxvt-unicode"] + if (myt in legal_terms) or myt.startswith("xterm") or myt.startswith("screen"): - if (myt in legal_terms) or myt.startswith("xterm"): sys.stderr.write("\x1b]2;"+str(mystr)+"\x07") sys.stderr.flush() + if (myt.startswith("screen")): + sys.stderr.write("\x1bk"+str(mystr)+"\x1b\\") + sys.stderr.flush() + def xtermTitleReset(): if havecolor and dotitles and os.environ.has_key("TERM"):
My screen-tabs with root-shells are named "root" (the name is also displayed in the caption-thingy). If I emerge something, the tab is renamed to "emerge ..." and after the emerge the tabs name is "screen". Probably because the aterm's title is "screen". I made some screenshot: befor (http://www.fh-rosenheim.de/~emil.beinroth/befor_emerge.png), during (http://www.fh-rosenheim.de/~emil.beinroth/during_emerge.png) and after (http://www.fh-rosenheim.de/~emil.beinroth/after_emerge.png) the emerge.
Actually, you can use the same escape sequence currently used to set the window title to set the screen status. However, the screen term change does have to be done, so you wouldn't need quite as much redundant code. It would be nice if screen didn't put the platform and just used "screen" like it used to - as then the current portage code would work (likely working when written). I do think that screen should have the caption turned on by default in /etc/screenrc as many people want this feature and don't have it (I added a CPU temp output from /proc/acpi as well as emerging can show temp problems if you have them). Resetting the title to "screen" in the examples by Emil, has to do with the reset, xtermTitleReset .. expected behavior.
Personally I do not like this enhancement. I use the following in my .screenrc which gives me a 1 line caption and a 1 line "tab bar". caption always "%{= bb}%{+b w}Screen: %n | %h %=%t %c" hardstatus alwayslastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<" This enhancement simply gives me a 50+ character tab and I have no way of turning it off, example: http://dev.edeca.net/screen.png Perhaps a USE flag of "screen" could be used to turn this feature on or off? Or even a setting in ~/.portage or similar.
This is not an "enhancement" or an "improvement"; it is a bug, plain and simple. If I set my screen window's title to something, and some rogue program comes along and changes that so that I have to reset it again, that program has a bug which needs to be corrected. Please fix this bug in emerge. I'm tired of constantly having the change the screen title for the window that I run emerge in.
FEATURES="notitles" ?
100% agreed with comment #4 _if_ someone want's the "emerge-status" shown in it's screen status-line he can mess with the hardstatus herself. in general it's always difficult to enable features (like suggested in comment #2 "caption by default") as you can _never_ please all users; _if_ you disappoint users anyway it's best to leave the upstream-defaults of the package as the official documentation for that package (faqs, mailing-lists, ...) will provide answers for the common problems.
Please provide a method to disable this emerge behavior. I've been manually editing output.py everytime I get a new version of portage, and it's a pain! I can still see all that emerge info in the xterm title, but I don't want it in my screen titles. I have carefully picked my screen titles to be able to quickly tell what windows I have open and where they are. They are meant to be _short_ descriptive titles.
Created attachment 54484 [details, diff] setting the screen title gets controlled by environement variable The patch introduces an environment variable "SCREEN_PORTAGE". If set to "set_title" the Screen Title will be set to the Portage hardstatus. Otherwise the screen stays as it is.
The above patch is my attemt of fix my mess. I tought an environement variable would work best, because 1. it can be set from either the profile or the screenrc itself, 2. its very easy to implement in output.py and 3. I didn't think yet another USE Flag or Option in make.conf would be warranted. Happy Eastern Everyone
What's wrong with FEATURES="notitles" ?
FEATURES="notitles" would also turn of xterm-titles .. but we want them. What we don't want are messed up screen-titles!
Created attachment 54537 [details, diff] setting the screen title gets controlled by FEATURE Additionally to what has already been said, from what I have read, I now believe the setting of the screen-title should be optional, not default. FEATURES=notitles however, is not set on default. The above patch works on the portage work-image directory and introduces a Feature "screentitle", that if set, enables updates of the screen-title. As this might be more tidy than the environement variable, I'm marking the previous patch as obsolete. However now we have an additional import statemant that I would have liked to avoid, but never mind ...
Reverting this for the next release. Will bring it back later on when it can be done not so messily.
*** Bug 100075 has been marked as a duplicate of this bug. ***
People complaining
Yes, I was wandering why I dind't have anymore that wonderful feature...I'd like to have it back, possibly enabled by FEATURE. :)
i have the impression that re-inventing the wheel is very popular nowadays: comment #3 suggests a way how to use the perfectly well working xterm-title with screen. a minimalistic example for the "comment #3 way" is: caption string "%n %t [%h]" the "[%h]"-part is exactly what is shown in the xterm-title. so no need for a new FEATURE.
(in reply to comment #17) I already have a windowlist status line as seen in comment #1. I have no use for additionally duplicating the xterm's window title display inside screen. I do, however, want portage to update my SCREEN window title, as it used to. I should not have to continue maintaining a personal output.py patch for this. I vote for the FEATURES solution.
So, what is required here? FEATURES="-xtermtitles screentitles" ?
Sounds perfect.
I guess sthis still isn't in Portage. Any updates...?
I somehow doubt this patch still applies; I know the make.conf stuff will fail, and there is probably a better way to do titles overall. -Alec
I think we should make this controlled via and emerge command line option. You'll be able to put the option in EMERGE_DEFAULT_OPTS to enable it by default. I don't think FEATURES should be used for simple changes in the emerge UI like this. For example, color output is controlled by the --color option rather than a FEATURE.