Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Sat, 11 Jan 2003 12:57:47 +0000 To: cygwin AT cygwin DOT com Subject: Re: [Bug] 1.3.18-1: Problem with arrow keys and rxvt/bash/mc Message-ID: <20030111125747.GB9970@convex.org.uk> References: <20030111004052 DOT A20688 AT fnord DOT io DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030111004052.A20688@fnord.io.com> User-Agent: Mutt/1.4i From: Stuart Brady 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 -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/