Skip to content

Mappings are not applied to the <Esc> and the following key for unmapped ALT- keystrokes #15869

Closed
@zeertzjq

Description

@zeertzjq

Neovim version (nvim -v)

NVIM v0.6.0-dev+373-g36408146a

Vim (not Nvim) behaves the same?

no, vim 8.2.3441

Operating system/version

Arch Linux

Terminal name/version

kitty 0.23.1

$TERM environment variable

xterm-kitty

Installation

Build from source

How to reproduce the issue

  1. Run nvim --clean
  2. Add mappings :nnoremap <Esc> <Cmd>echomsg 'Esc'<CR> and :nnoremap x <Cmd>echomsg 'x'<CR>.
  3. Press ALT-x or press <Esc> and x quickly
  4. Run :messages

Expected behavior

There are two lines of messages:

Esc
x

Doing the same things in Vim in terminal shows these two messages.

Actual behavior

There are no messages


Since a key typed too fast following <Esc> in terminal is indistinguishable from an ALT keystroke, I think it is reasonable that mappings should be applied to the <Esc> and the following key just like they are applied to normally typed keys if the ALT- keystroke is unmapped.

Metadata

Metadata

Assignees

No one assigned

    Labels

    coreNvim core functionality or codeenhancementfeature requestinputmappingskey bindings

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions