Khimenko Victor wrote:
More like problem with *nix design (not even *nix exacly bu more like old unix terminals design - it's stupid, ugly and unneeded but it's used by SUCH big number of systems all around the world now that it's really not worth trying to fix).
One could probably fix it (under Linux at least) by changing the keymap (or the kernel) and the termcap and terminfo entries.
What about xterm, kterm and bunch of VT100 emulators ?
If you have the source, you can change it. I never said it would be easy or even practical... ;-)
God knows. I've looked on few programs where ESC works "just fine" like ViM and/or minicom. Minicom is using "console approarch" explained above (and works without delays only for console) while ViM is goeing even further: if it gets ESC it will wait for VERY short time and then will react just as ESC should do (will go out of insert mode, for example) BUT will remember that ESC was just pressed AND if later it'll find valid code for arrows and such it will undo ESC work and do what whould be done for left-arrow or right-arrow. Both solutions hardly look partable to me :-/
Wow, what a hack! ;-) But most programs can't do it like vim, I guess...
Looks like it's all what can be done: give CRT user all the information about ESC problems and let him decide what to do with it. Looks like there no universal solution anyway.
Doesn't seem so. But as I said, setting ESCDELAY appropriately, I get along fine on various terminals, emulators and consoles, even across networks.
P.S. A lot of programs (like Emacs or bash) just use ESC as prefix and do not assign ANY meaning by itself: ESC,1,2,3 is the same as Meta-1,2,3 and is "repeat next command 123 times", Esc,* is the same as Meta-* (put names of files with common prefix in command line) and so on. It's REAL handy when you are using dumb terminal (like Microsoft's built-in telnet :-)
Oh yeah, that's very dumb. I once had to use it...
without Meta- support and (on other hand) it's most reliable way to handle ESC. It looks like most natural thing to do if you'll think about it...
I'm not so sure. I like the meaning of ESC to abort an operation, and I don't like the idea of two different keys (ESC and Alt/Meta) doing basically the same. But that's probably a matter of taste, let's not get into an vi vs. Emacs flame war (I'm a fan of neither, anyway ;-).
Frank