On 2/23/09, Bram Moolenaar <[email protected]> wrote:
>
> 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.

key Co: 256
key Co: 256
key ku: ^[OA
key kd: ^[OB
key kr: ^[OC
key kl: ^[OD
key #2: ^[OH
key #4: ^[OD
key %i: ^[OC
key *7: ^[OF
key k1: ^[OP
key k2: ^[OQ
key k3: ^[OR
key k4: ^[OS
key k5: ^[[15~
key k6: ^[[17~
key k7: ^[[18~
key k8: ^[[19~
key k9: ^[[20~
key k;: ^[[21~
key F1: ^[[23~
key F2: ^[[24~
key %1: ^[[28~
key &8:
key kb: ^H
key kI: ^[[2~
key kD: ^[[3~
key kh: ^[OH
key @7: ^[OF
key kP: ^[[5~
key kN: ^[[6~
key K1: ^[OH
key K3: ^[[5~
key K4: ^[OF
key K5: ^[[6~
key kB: ^[[Z

-- 
Paul

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

Raspunde prin e-mail lui