Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Terminal Titles
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
joycea
Apprentice
Apprentice


Joined: 23 Jul 2002
Posts: 191
Location: Kingston, Canada

PostPosted: Sun Mar 23, 2003 1:30 am    Post subject: Terminal Titles Reply with quote

As I was updating my system today, I got to wondering where in the update process portage was. I found myself trying to dissect the filenames as they flew past to determine what package it was. I was thinking that it shouldn't be too hard to add an option to Portage to have it set the title of the terminal to something like "Portage - Building smbfs-1.2.1 [12/24]"

My question is: does anyone think this is an idea worth submitting to bugzilla? I started wading through the Portage code as I felt that it shouldn't be too hard to add this myself. Seeing as I have never programmed in Python before though, this ended up being harder than I initially thought. Maybe if there is enough positive response I'll spend the time to figure it out and post a patch or something.

As a followup, can anyone think of reasons why changing the window titles might be a bad/awful idea?
Back to top
View user's profile Send private message
Strubenator
n00b
n00b


Joined: 17 Mar 2003
Posts: 19
Location: Frederick, MD

PostPosted: Sun Mar 23, 2003 2:58 am    Post subject: Reply with quote

It sounds like an excellent idea to me!

I've never programmed python either...but we all have to learn sometime.

--Strube
Back to top
View user's profile Send private message
CountZero
Tux's lil' helper
Tux's lil' helper


Joined: 21 Jan 2003
Posts: 79
Location: Arlington, TX, USA

PostPosted: Sun Mar 23, 2003 6:53 am    Post subject: Reply with quote

I would have to approve of the idea. It wouldn't be extra bloat or anything like that. It's just a matter of setting an environment variable and then unsetting it when the process is done. Unfortunately, I've never programmed in Python either (gonna learn somday) so I can't be much help. There's no harm in submitting it to Bugzilla.
Back to top
View user's profile Send private message
dma
Guru
Guru


Joined: 31 Jan 2003
Posts: 437
Location: Charlotte, NC, USA

PostPosted: Sun Mar 23, 2003 7:41 am    Post subject: Reply with quote

Here's the escape sequence (there are also escape sequences for minimize window, etc):

http://www.tldp.org/HOWTO/mini/Xterm-Title-3.html

Code:

                        if not "--pretend" in myopts:
                                print ">>> emerge ("+str(mergecount)+" of "+str(len(mymergelist))+")",x[2],"to",x[1]
                                emergelog(" >>> emerge ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[2]+" to "+x[1])
                        if x[0]=="ebuild":


If you want to hack yours, go for it.
Back to top
View user's profile Send private message
jagerman
Tux's lil' helper
Tux's lil' helper


Joined: 27 Jun 2002
Posts: 104
Location: Vancouver, BC, Canada

PostPosted: Mon Mar 24, 2003 4:03 am    Post subject: Re: Terminal Titles Reply with quote

joycea wrote:
As a followup, can anyone think of reasons why changing the window titles might be a bad/awful idea?


If you are on the console (you know, Ctrl-Alt-1 through 6), you'll see a few ugly control characters and the title, because it doesn't recognize the xterm title control characters.

To get around it, you can do it nicely by getting the term info, and only displaying it if the terminal supports it, or as a hack by only showing it if $TERM = "xterm" or "xterm-color".
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Mon Mar 24, 2003 5:31 am    Post subject: Reply with quote

I have heard rumors that this (or something quite similar) may appear as soon as 2.0.47-r11.
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
jagerman
Tux's lil' helper
Tux's lil' helper


Joined: 27 Jun 2002
Posts: 104
Location: Vancouver, BC, Canada

PostPosted: Mon Mar 24, 2003 5:39 am    Post subject: Reply with quote

rac wrote:
I have heard rumors that this (or something quite similar) may appear as soon as 2.0.47-r11.


Let me confirm the rumor:
Quote:

22 Mar 2003; Nicholas Jones <carpaski@gentoo.org> emerge: Added
'xtermTitle' calls to emergelog to set the title during phases of merging.
Added more emergelog calls to provide more specific information.

(from http://cvs.gentoo.org/cgi-bin/viewcvs.cgi/gentoo-src/portage/ChangeLog?rev=HEAD&content-type=text/vnd.viewcvs-markup)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum