Paul Evans wrote: > On Mon, 14 Apr 2014 04:56:00 -0700 (PDT) > Ben Fritz <[email protected]> wrote: > > > > To reproduce: > > > Start vim, *quickly* type the keys: i<Esc>Om > > ESC O is SS3 > > > > Expected result: > > > New line created above the current one with the letter 'm' in it > > > > > > Actual result: > > > Hyphen inserted on current line > > > > > > Also affects: > > > Letters j,k,n,o > > > j gives *, k gives +, m gives -, n gives ., o gives / > > SS3 j/k/n/o are the codes XTerm and similar use for number keypad > symbols. > > > > Vim version: 7.4 (as installed by Ubuntu 13.10) > > > Happens on my machine, my co-worker's machine, several VMs and to > > > some (not all) of the people I asked about it on IRC. Definitely > > > requires that the typing is done quickly. Causes me problems very > > > frequently because I write a lot of Perl and when I go to declare a > > > variable, I get "-y $foo" on the current line instead of "my $foo" > > > on the previous line. > > > > This looks like you're using Vim in a terminal, and you are typing > > fast enough for Vim to interpret your keystrokes as terminal key > > codes. > > This /once again/ is another fallout from my seemingly never-ending > point of "can Vim please use proper keyboard input handling instead of > stupid 1980s stuff"; whereupon an entire class of bug like this will > just disappear. > > Specifically in this case, what vim /ought/ to do but doesn't, is set > the terminal into "8-bit" mode, using the S8C1T sequence. After doing > that, these keypad SS3 sequences will be sent using /only/ the SS3 byte > (0x8f) and never by Escape O. After doing this, vim will no longer need > to rely on stupid timing tricks (see ttimeout and friends), because any > received Escape (0x1b) byte will be a REAL <Escape> keypress and never > a sequence. > > Please please Bram - please look into this. If you fix this, there's a > huge class of user-facing problems like this which will never again > surface.
Whether the terminal is in 8 bit mode is the choice of the user (or the administrator or the system). Vim switching the terminal to 8 bit mode might break lots of things. Not sure what and when, since we'll probably only find out after doing it. Vim should be able to detect the terminal being in 8 bit mode and use that. So it's a matter of the user switching the terminal to 8 bit mode. -- Keyboard not found. Think ENTER to continue. /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
