On Tue, Jun 19, 2007 at 01:53:26PM +0200, Dag Wieers wrote:
> On Tue, 19 Jun 2007, Andrew Pollock wrote:
> 
> > On Tue, Jun 19, 2007 at 11:31:10AM +0200, Marc Lehmann wrote:
> > > Come on folks, this is a BUG, not a wishlist item. It destroys a setting a
> > > user has made without asking.
> > > 
> > > > How it works in Bash is that the PROMPT_COMMAND contains the escape     
> > > >                                      
> > > 
> > > This is complete and utter bullshit. PROMPT_COMMAND does exactly what it
> > > does, namely exactly what the user configured it to do. Changing the title
> > > is not a bash feature in any way, it is completely unrelated to bash.
> > 
> > Less anger :-)
> >  
> > fwiw, I'm inclined to agree with you, changing the xterm's title is somewhat
> > obnoxious, and from my research, there appears to be no way to retrieve the
> > current title, so there's no way to restore it after changing.
> > 
> > Relying on the user's environment to re-overwrite the title after
> > termination is, well, relying on hope too much, because there's no reliable
> > way to ensure that this is going to happen.
> > 
> > Dag, I think you need to consider your users some more. The current title
> > you set doesn't really buy the user a lot, so I think given we've got at
> > least one user who's rather passionately against it (and it's bitten me more
> > than once before as well), I think I'll patch it out of the Debian package.
> 
> I think the reason why on Debian it's not liked is because it behaves 
> differently than Red Hat/CentOS/Fedora in this regard.

I think because it *can* behave differently is the problem. For me, it works
fine, because I'm using Bash, and have a COMMAND_PROMPT set, everything
reverts fine and dandy. I dare say Marc's doing something different, because
he can. I'm sure there are situations with Red Hat/CentOS/Fedora where
something similar can be done that would make the terminal changing be
undesirable as well. Linux distros tend to give enough flexibility that you
can't assume all users' environments are going to closely match your own.
 
> As I said, I'm interested to change it in such a way that it works 
> correctly in both situations. I added it because it was useful in the same 
> situation where dstat was useful and I see it as an integer part of dstat.
> 
> (if you interactively monitor 5 to 10 clusters, you need a way to find out 
> which output belongs to what machine and space is scarce)
 
Fair enough, there is a valid use-case. One could also argue that that
information may well already be in the xterm title though.

> I have no problem if you patch it out as long as you add an option to 
> enable it when users require it. In fact, if you like I can produce a 
> patch to do this and ship it with dstat ? Is that useful ?

I think that is the best way to go. At present, I've got a patch that just
yanks out the lines that change the title altogether. Adding another option
to not set to the title is going to appease the likes of Marc I think. I
don't know whether the default behaviour should be changed or not. I think
maybe it should, but you're the author, you're well within your rights to do
whatever you like ;-)

Maybe it's time for a configuration file?

regards

Andrew

Attachment: signature.asc
Description: Digital signature

Reply via email to