Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
h3xx opened this issue Nov 9, 2023 · 0 comments
Open

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

h3xx opened this issue Nov 9, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@h3xx
Copy link

h3xx commented Nov 9, 2023

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.
@ima1zumi ima1zumi added the enhancement New feature or request label Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants