Ctrl-Shift-key Beeps and Doesn't Send to Termi

2019-02-07 14:00发布

问题:

My OS X terminal does not seem to recognise Ctrl-Shift. Instead, it beeps when I hit Ctrl-Shift and any other key on the keyboard. I use Emacs and as a result I cannot use many shortcuts. It is not the Bash beep, but the OS X beep.

How can I get my Terminal to recognise Ctrl-Shift-anykey?

回答1:

There is no standard for transmitting modifier keys through a tty; however, xterm defines a method, and some other terminal emulators support it. Terminal does not directly support this, but you can customize Terminal’s keyboard preferences to map some other key to the sequence that emacs recognizes:

Preferences > Settings > [profile] > Keyboard

Xterm’s generalized encoding of modifier keys is described briefly at the end of the PC-Style Function Keys section of the XTerm Control Sequences documentation.

You can see the sequences that emacs supports by entering M-x describe-bindings RET. For example, emacs recognizes the sequence

M-[ 2 7 ; 7 ; 4 7 ~

and maps it to

C-M-/

You can use this list to discover similar sequences that communicate other modifier key sequences through a tty.