I'm trying to use Apple's ⌘ command and ⌥ option keys to map some functions in readline
to no avail.
As per the man page I used octal values but that doesn't seem to work
\xHH the eight-bit character whose value is the hexadecimal value HH (one or two hex digits)
For example
# command + j
"\0x37j": "\C-a\C-k"
# option + j
"\0x3aj": "\C-a\C-k"
# control + j
"\0x3bj": "\C-a\C-k"
But octal values don't seem to work for chars on the right side of the mapping either.
# insert char h
"\C-xz": "\0x4"
I know I can use Karabiner, but I'm trying to make this work without third-party applications and to see if it's actually supported or what I'm doing wrong. And I know that in Terminal I can use option mapped to meta, which I don't intend.
showkey
command shows the key codes sent by the terminal. You should look for the OSX equivalent, but as Gilles says some keys don't generate any code and are therefore unusable in terminals.script
but nothing is retrieved when pressing ⌘. @Gilles, in Terminal's preferences there's indeed the option to send strings with a combination of modifiers and other keys, but not for ⌘ alone. I thought the client is always sending some code and it's the shell that filters it out, but again I have to read the answers you referenced first to make further assumptions.script
only shows you what the terminal receives. If the terminal doesn't pass the keystroke through, it doesn't see anything. The shell doesn't filter anything.