On Sun, Feb 24, 2008 at 04:47:21PM +0100, Bram Moolenaar wrote: > > James - > > > In term.c's check_termcode, there is code to handle the response to > > "CSI>0c" (request terminal version) which is of the form > > "CSI>{x};{vers};{y}c". The format of {vers} isn't strictly defined but > > the current code assumes that the response will only be made up of > > digits, ';', and '.'. > > > > When this assumption is wrong (as was the case with a recent mrxvt > > version which contained a '+'), the parsing stops early and any unparsed > > characters end up being fed to Vim as if they were key presses by the > > user. This caused anyone using Vim inside mrxvt to start in > > operator-pending mode from the 'c' that Vim received. > > > > I've attached a patch which simply reduces the conditional check of the > > for loop that does the parsing to "i < len && tp[i] != 'c'". > > The problem with checking for a 'c' is that we gobble up too much if we > get another escape sequence.
We may be parsing something other than a response to T_CRV here? > I think every escape sequence is supposed to end in a letter. So we > could use this loop: > > for (i = 2 + (tp[0] != CSI); i < len && !ASCII_ISALPHA(tp[i]); ++i) Quickly looking over xterm's control sequences[0], there are sequences that don't end in a letter but responses to T_CRV should always end in c. James [0] - http://www.xfree.org/current/ctlseqs.html -- GPG Key: 1024D/61326D40 2003-09-02 James Vega <[EMAIL PROTECTED]>
signature.asc
Description: Digital signature