Skip to content

Key mappings using Meta- prefix don't map #603

Closed

Description

@h3xx

Description

The regex used forces quotes to surround the key sequence, otherwise key presses aren't even interpreted. Unfortunately this means the readline standard way of specifying modifier keys (Ctrl-x, Meta-y, C-o, M-e etc) don't get picked up.

Oh, and "Meta-c" (with quotes) is not the same thing as "\ec".

An Emacs‐style notation is used to denote keystrokes. Control keys are denoted by C-key, e.g., C-n means Control-N. Similarly, meta keys are denoted by M-key, so M-x means Meta-X. (On keyboards without a meta key, M-x means ESC x, i.e., press the Escape key then the x key. This makes ESC the meta prefix. The combination M-C-x means ESC-Control-x, or press the Escape key then hold the Control key while pressing the x key.)

-- readline(3)

In my ~/.inputrc:

$if Ruby
Meta-c: ".class.name"
$endif

Opening up rails console and typing Alt+c does not produce any output.

Expected outcome is to insert .class.name at the current cursor position.

If I remove the $if / $endif lines, the keymap will apply to Bash, and indeed pressing Alt+c in Bash inserts .class.name onto the current line.

Terminal Emulator

PuTTY 0.79 for Windows.

Just to be sure input isn't getting munged: xxdEnterAlt+cEnterCtrl+d

$ xxd
^[c
00000000: 1b63 0a                                  .c.

Activity

  1. added
    enhancement
    on Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions