Paul B. Mahol wrote:

> >> Tony Mechelynck wrote:
> >> > On 21/02/09 06:30, Bram Moolenaar wrote:
> >> > >
> >> > > Ben Fritz wrote:
> >> > >
> >> > >> Saw this interesting post to a tip on the wiki:
> >> > >>
> >> > >> http://vim.wikia.com/index.php?title=Fix_broken_arrow_key_navigation_in_insert_mode&diff=22116&oldid=prev
> >> > >>
> >> > >> Apparently this xterm bug report:
> >> > >>
> >> > >> http://bugs.gentoo.org/212546
> >> > >>
> >> > >> has been blamed on Vim, but for whatever reason the poster does not
> >> > >> expect useful help from this list.
> >> > >>
> >> > >> Just making sure people were aware of it here.
> >> > >
> >> > > I'm missing the part where it says what exactly it is that Vim would
> >> > > be
> >> > > doing wrong.  I don't see the problem anyway.
> >> > >
> >> >
> >> > A comment to that bug report says the problem disappears when invoking
> >> > "xterm -kt vt220". From what I can tell, the problem seems to be related
> >> > with some gentoo-specific "bugfixes" (sic) to the xterm code and/or
> >> > configuration.
> >>
> >> Wrong. Same heppens here on FreeBSD, xterm version X.Org 6.8.99.903
> >> (238)
> >> Disabling tcap-query makes vim happy.
> >>
> >> I think it is vim bug because when starting vim intro message appears
> >> and quickly dissapears.
> >
> > That's normal.  It happens when the assumption Vim makes about the
> > number of colors supported is corrected when the termcap-query results
> > comes in.  Vim needs to redraw the screen then.  It also means you might
> > get wrong colors when you disable termcap-query.
> 
> Maybe it really is normal, but I like intro messages very much :)
> >
> > In the situation that it doesn't work properly, what is the output of
> > ":set termcap"?
> 
> Here it is:

The essential parts:

> --- Terminal keys ---
> t_kl <Left>      ^[O*D
> t_#4 <S-Left>    ^[OD
> <xLeft>     ^[[1;*D
> t_kr <Right>     ^[O*C
> t_%i <S-Right>   ^[OC
> <xRight>    ^[[1;*C

Thus the shifted cursor keys are defined wrong.

Where does this information come from?  We need to find out if Vim gets
the wrong information or that the information is misinterpreted by Vim.

Unfortunately the only way is to add some debugging code.  The relevant
function is got_code_from_term().  You could apply this patch:

*** term.c~     Wed Jan 28 14:46:28 2009
--- term.c      Sun Feb 22 23:54:41 2009
***************
*** 5473,5478 ****
--- 5473,5479 ----
            for (i = 8; (c = hexhex2nr(code + i)) >= 0; i += 2)
                str[j++] = c;
            str[j] = NUL;
+ smsg("key %s: %s", name, str);
            if (name[0] == 'C' && name[1] == 'o')
            {
                /* Color count is not a key code. */

After compiling Vim, run it and type ":mess".  It should then show you
want Vim received.

-- 
"Computers in the future may weigh no more than 1.5 tons."
                                   Popular Mechanics, 1949

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui