xterm_title patch 898
Tomas Styblo
tripie at cpan.org
Tue Jan 14 12:09:52 UTC 2003
* Adam Byrtek 'alpha' <alpha at student.uci.agh.edu.pl> [Sun, 12 Jan 2003]:
> On Sun, Jan 05, 2003 at 05:39:54AM +0100, Tomas Styblo wrote:
> > In my humble opinion the restore does not work over network
> > because the implementation is fundamentally broken.
> Yes, I fully agree. It was just a dirty hack to start with. I was
> thinking about this issue during Christmas vacation and I see no easy
> way to implement this in a clean and compatibile way.
[SNIP]
> First of all we have to choose between blocking and non-blocking
> behaviour to read old xterm title. Blocking is bad - if one's xterm is
> broken and didn't respond, user can wait forever, which is
> unacceptable. Non-blocking is also bad - we have to set some arbitrary
> timeout to wait for response on slow links, but it is unacceptable to
> force user with broken xterm wait 5 seconds. And if the response
> arrives after the timeout, it clutters the screen.
>
> And no, TERM env variable IMO is not a reliable way to detect xterm
> capabilities.
>
> I see no good approach. I guess we could implement Tomas' patch as a
> additional option 'store/restore xterm title', which will be *turned
> off* by default. But I'm not sure if this feature is really so
> important. I personaly use shell to refresh title to cwd on every cd
> or execution.
My patch is bad. The delay seems to be unconditional on some
people's OSes.
I checked how vim sets and restores the title.
It uses a completely different approach.
It looks at environment variables WINDOWID and DISPLAY and
connects to the X server using xlib. Then it gets and sets the
title using the xlib functions XGetWMName and XSetWMName.
It works very well in my experience. But it may not work
remotely, when X forwarding is not enabled in ssh configuration.
Maybe we should consider using this approach to restore the title ?
> Yes, I think your plan (XTERM_TITLE variable) is good. It would be
> very hard to convince people, but I think you should try.
I already have the library to implement it ready. It does not take
care of restoring the title, though. I already got patches for
some popular terminal applications to use the library to set a
title. If you are interested in it, please contact me privately.
--
Tomas Styblo <tripie at cpan.org>
PGP: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xC97EA4B6
More information about the mc-devel
mailing list