This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Bug] 1.3.18-1: Problem with arrow keys and rxvt/bash/mc


On Sat, Jan 11, 2003 at 12:40:52AM -0600, Steve O wrote:
> The change I suspect is one that writes characters one at a time to the
> slave, instead of a bulk write of the entire buffer.  Thus, it's 
> possible for the slave to read half of an escape sequence in a 
> race condition.  I was under the impression that the slave, mc in
> this case, should be able to deal with this condition, or am I mistaken?

I'm not sure. Does this situation arise elsewhere? It seems reasonable
to send as much as possible in one single write. Remember that if
somebody sends ESC, you can't keep everything in a buffer until the
sequence ends, as this would break programs like vi.

On everything I've seen, the escape key actually sends ESC. If you press
escape, followed by some other characters, are those characters part of
an escape sequence or not? I suspect that these ambiguous sequences,
depending on timeouts and bulk writes to be complete nonsense, but it
looks like we're stuck with them now.

For example, in vim, type "iHello world" and press ESC, followed by
shift-O and then shift-D. If you do this quickly enough, you will still
be in insert mode (able to type stuff in) and the cursor will have moved
one place to the left.

If you wait about a second between pressing ESC and shift-O, and/or
between shift-O and shift-D, then you will firstly go into insert mode
on a newly created line (directly above where you were just typing),
and you will then enter the character D into this line.

No doubt if you press the left arrow key, generating the sequence all
in one go, this intermediary confusion is likely to be eliminated. If
there's a long enough pause between O and D being sent, when you press
the left arrow key, vim would insert D into a new line for you!

I notice that nvi isn't nearly as tolerant as vim. Most programs seem to
accept escape sequences that are typed in manually - nvi doesn't.

Oh, you wanted to quit vim? I'm sorry - press ESC, and type ":q!". :)
-- 
Stuart Brady


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]