[Konsole-devel] [Bug 169396] editing in vim gives unwanted pastes when using insert mode

Pavel Shved pavel.shved at gmail.com
Tue Dec 23 11:09:01 UTC 2008


http://bugs.kde.org/show_bug.cgi?id=169396


Pavel Shved pavel shved gmail com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pavel.shved at gmail.com




--- Comment #14 from Pavel Shved <pavel shved gmail com>  2008-12-23 12:09:00 ---
For vim i reproduced this many times.  KDE 3.5 and 4.1.  Both were on openSUSE
(various versions) and Gentoo.  evdev-driven wireless (sometimes correctly,
sometimes incorrectly set up) Logitech on Gentoo and out-of-the-box wired
Mitsumi on openSUSE.

I think i have figured out steps to reproduce.

1. Open vim.

2. Press O at any line--and press ESC immediately.  Do not move cursor
anywhere.

3. Repeat step 2 until you do it fast enough (you don't have to be extremely
fast, actually, you have nearly a couple of seconds).  You'll see that, after
some time, every time you press O, a new line is not inserted immediately. 
Instead you see the literal O symbol and only after notable pause will it
disappear and let you see a new line inserted and ready for typing.

4. If you type another symbol during that pause (between O symbol appearance
and new-line insertion), it will yield some weird stuff.  For example, typing
Om yields `-' character in the same line.  Typing OM yields new-line _after_
(not before) the current :-).  Some keys trigger <F2> or <F3> pressing...

The possible reason is that the process of interaction of vim and konsole (or
some other terminal layer) needs pauses when processing ESCAPE presses or other
non-printable characters.  If you try to do something else during these pauses,
it messes something up.  Also, this kind of queue is `flushable'; you flush it
by moving cursor.

I also noticed this bug when i was trying to write scripts that relied on
immediate handling of <ESC> key presses.

So, whose bug is it?  Not konsole's--I've just made it in gnome's terminal+KDE.
 And i remember it with totally non-kde ubuntu, but, that's to be checked
out--you have the steps now.

And, finally, it's totally OK out of X.  In simple console it isn't reproduced
(:imap a bbb<ESC><ESC>Oxxx  -- the script that helps in reproducing, to clarify
it's not the case that I'm just not fast enough).  So, that's not vim's bug.

So, that's probably the bug of terminal abstraction layer (if there is one, i
don't know) or keyboard mapper or something like that.


-- 
Configure bugmail: http://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the konsole-devel mailing list