Re: title refreshing (xtt) and the 4.6.0 release

2003-01-24 Thread Tribhuvan
Well enough on that one then - I thought it a liitle out of preportion
(for such a minor feature).  I'ts just when using mc on a production
machine without a fancy PS1 setting the dangling title was basically
sloppy.  Two or three lines of code near the end of main() to
print (even NULL) to the title bar should close this issue.
... and people like me should probably read the TO DO's a little
more frequently...

Tribhuvan

___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel



Re: title refreshing (xtt) and the 4.6.0 release

2003-01-24 Thread Adam Byrtek / alpha
On Fri, Jan 24, 2003 at 02:39:10AM -0500, Pavel Roskin wrote:
 I'm really surprised by the amount of interest to this topic and by the
 amount of time spent on it.  I even start thinking that maybe I shouldn't
 have applied the patch for changing the title, because the time spent on
 this issue could have been better spent on something else.

You are right, this issue takes too much time. But I fell obligated to
resolve this properly, as I was the one who made the mess by improving
the xterm-title :) Moreover it would be easier if you give us a clear
statement what you will accept and what you won't accept, and when.

My opinion is that xterm restoring is not critical, and if it will be
included in mc it can't give user any discomfort (timeouts) or force
him to change anything (conffiles). It also has to be clean and simple
coded (no offense Tribhuvan, but we should keep the simple thing
simple - that's the Unix way) and has to have some fallback when sth
goes wrong (depending on console i/o is not reliable imo).

Xlib approach satisfies this conditions. It fails in some cases, but
qis is so important? vim people use this, so maybe there isn't any
better way?

(If somebody knows how to obtain X windowid without WINDOWID env
variable, tell me)

Regards
alpha

-- 

  _.|._ |_  _.: Adam Byrtek, alpha@(irc.pl|debian.org)
 (_|||_)| |(_|: gg 1802819, pgp 0xB25952C0
 |: jid alpha.pl(at)jabber.org
___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel



Re: title refreshing (xtt) and the 4.6.0 release

2003-01-23 Thread Pavel Roskin
Hello!

 The patch using the Xlibs is 'clean' and efficient for refreshing the
 title on a _local_host_.

 Tested various combinations of Solaris 8, 9, Linux kernel 2.4.17 xfree86
 4.1.0, 4.2.0, 4.2.1 with 6 or 7 different terminals, but have yet to
 reconfigure one or two solaris machines to test with the XSun xserver.
 All favorable results on a local machine.

I'm really surprised by the amount of interest to this topic and by the
amount of time spent on it.  I even start thinking that maybe I shouldn't
have applied the patch for changing the title, because the time spent on
this issue could have been better spent on something else.

  - It can't really be done in less than 100 lines of code.
 (at one point I had 250 lines)
 As a non-critical function, to avoid bloating main.c,
 should it be moved out to something like xtt_restore.c ?

I'd rather remove 10 lines to set the title than add 250 lines to restore
the title.

 - For use on a local host, a delay in the request/read xtt
of a few millisec using usleep() resolves any mis-reads
of  the output from \033[21t . But on a remote host,
the delay can't be less than one second. Because most
users are on a local host (correct me if I'm wrong),
the default delay should be set for local. Then, for remote
host sessions, the delay for the timeout could be adjusted
on-the-fly (by editing $HOME/.mc/ini or even better,
by a command line option like mc -r).

Just imagine that you know nothing about mc and you are reading the help.
Would you understand what this is about?  I can imagine that some users
would be confused and will blame unrelated problems on the incorrect
delay.  I can imagine users writing a wrapper around mc to set the
timeout correctly if they log in remotely.  Yet the same users will close
mc together with the terminal without ever needing the saved title.

On exit from mc, just print something generic like:
xterm: [shell] or username@hosname
 to overwrite the hanging xterm_title.

It used to be Thank you for using GNU Midnight Commander in 4.5.55.
Too long for my taste.

I think that if you expect the audience of the patch (i.e.  those who
really care about the title after they exit mc) to edit $HOME/.mc/ini
and/or give command line options when running mc remotely, then probably
the same users won't have any problem adding something like this to the
environment:

PROMPT_COMMAND='echo -ne \033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\007'

It's standard in Red Hat 8.0 and it sets the title after every command,
not just mc.

-- 
Regards,
Pavel Roskin
___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel