Re: Using mc via telnet



Hi!

Yes.  "Learn Keys" is just a cheap substitute to making the keys work as
they are described in terminfo and/or termcap.

I don't call it "cheap"!  I call it an EXCELLENT feature!!!
I wish more applications would follow this route.

Incidentally, I have been thinking about it.  It is clear for me that the
terminfo standard doesn't solve all problems present in termcap.  What MC
actually does is an attempt to work around deficiencies of the terminfo
standards, not just "bugs" in the terminfo database.

The terminfo relies solely on the TERM variable, which is actually not so
reliable.  On my pretty standard RedHat 7.1, both xterm and rxvt set
TERM=xterm by default.  And yet F1 sends "\eOP" on xterm and "\e[11~" on
rxvt.

If you look in mc.lib, you will find that some keys are defined more than
once to work with different terminals with the same TERM.  This is not
allowed in terminfo definitions (as far as I know).

More definitions are added "behind the scenes", in the code, because even
the format of mc.lib is not sufficient to express the rules.  So, for
example, "\eOP" is added as another definition of F1 if $TERM begins with
"xterm".

Another problem is that if you are running telnet in xterm and you have a
working connection back from the remote host to your X server, it is a
different situation than when the X connection is not available (i.e. you
are behind firewall).  MC compiled with X events support can distinguish
Ctrl-M and Enter in the first case, but not in the second.

Finally, there is no way to describe in terminfo keys with modifiers e.g.
the sequence for Shift-Home.  Yet it's well defined and unique in rxvt.

If you want to share the "Learn Keys" code with other applications, it
means establishing a standard.  For a standard to succeed, it must be very
good (or you should have influence of software vendors, which is not the
case).

I think that "Learn Keys" is not sufficient for even MC itself.  Run MC in
xterm and try selecting text in the editor with Shift-arrows.  It doesn't
work?  Now go to "Learn Keys".  The Shift-arrows are not there.  They are
not in terminfo either.

Terminfo is good if you don't want to use your terminal to the maximum
extent possible.  But if you want to use any keys in any combination
allowed by your hardware, terminfo is too restrictive.

What MC is doing now is creating a "better terminfo" with support for
multiple sequences per key, new keys combinations and support for data
from the sources other that the terminal (X11 events, linux specific
ioctl).

Another solution would be creating a new terminal client-server protocol
and designing both the terminal (a reference terminal) and the screen
library in the same time.  I believe it's a much cleaner approach.

I do not think this has chance of succeeding.

That protocol already exists. Its called X. Its better terminal
protocol. Oops, it includes graphics ;-).
                                                                Pavel
-- 
I'm pavel ucw cz  "In my country we have almost anarchy and I don't care."
Panos Katsaloulis describing me w.r.t. patents at discuss linmodems org




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]