zsh-users
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Oliver Kiddle <okiddle@yahoo.co.uk>
Cc: alx741@riseup.net, Zsh Users <zsh-users@zsh.org>
Subject: Re: Vimode problem (key press dropping)
Date: Wed, 29 Jul 2015 14:35:51 +0200	[thread overview]
Message-ID: <CAHYJk3SDG5r0i3+=vRMt_ERVpwmwnf0Y3S2cf60_PpLa2mf7Tg@mail.gmail.com> (raw)
In-Reply-To: <9361.1438161965@thecus.kiddle.eu>

On Wed, Jul 29, 2015 at 11:26 AM, Oliver Kiddle <okiddle@yahoo.co.uk> wrote:
> alx741@riseup.net wrote:
>>
>> When i hit ESC two times the next letter is ignored, so in order to
>> enter insert mode i need to hit 'i'/'a' two times two. This is the same
>> for any even number of ESC, the problem is the same for 4 hits but no
>> for 3 times so i can say the second ESC hit leave the shell listening
>> and it just drop the next key press.
>
> The problem is that from vi command mode, the escape key is not bound to
> anything. If you bind escape to do absolutely nothing, the problem goes
> away.
>
>   bindkey -as '\e' ''
>
> Or alternatively, the following is what vim does:
>
>   bindkey -a '\e' beep
>
> Part of the reason behind the behaviour you see is that the cursor keys
> typically are bound and when you press the cursor keys, what zsh sees is
> an "escape sequence": a series of characters that start with an escape
> character. This also means that after seeing an escape character, zsh
> has to wait to see if more characters arrive. You might also want to
> tweak the KEYTIMEOUT variable to reduce this delay.
>
> Question to -workers subscribers: how should we address this in the
> defaults? I also have escape bound to set REGION_ACTIVE=0 from the
> visual keymap which should perhaps also be default behaviour (vim does
> that). Note that escape being a prefix character is what causes the
> subsequent 'i'/'a' to be ignored.
>
> Oliver

I always felt like how it should work if we get the string "abc", is
first abc is looked up and we find it isn't bound to anything, the a
gets treated as a separate input string, then we look up bc instead,
etc. What we do now is just discard the whole string as
"undefined-key".

-- 
Mikael Magnusson


  reply	other threads:[~2015-07-29 12:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-29  5:17 alx741
2015-07-29  9:26 ` Oliver Kiddle
2015-07-29 12:35   ` Mikael Magnusson [this message]
2015-07-29 15:30     ` Bart Schaefer
2015-07-29 15:35       ` Mikael Magnusson
2015-07-29 15:51         ` Bart Schaefer
2015-07-29 16:31           ` Mikael Magnusson
2015-07-29 16:45         ` Oliver Kiddle
2015-07-29 17:49           ` Bart Schaefer
2015-07-29 17:53             ` Bart Schaefer
2015-07-29 18:32   ` alx741

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHYJk3SDG5r0i3+=vRMt_ERVpwmwnf0Y3S2cf60_PpLa2mf7Tg@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=alx741@riseup.net \
    --cc=okiddle@yahoo.co.uk \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).