Question

Like control key is represented by a '^' in the terminal, what is the equivalent for the command key (mac)?

I am trying to remap my bash shortcuts using stty

For eg

stty eof ^D

But instead of control, I want to use the command key.

EDIT:

Okay so the issue I was trying to solve was that I wanted to interchange command and control keys because I work on osx and linux and the different key combinations cause me a lot of pain.

So I interchanged the modifier keys using osx preferences. But now all the bash shortcuts like Ctrl+C etc had become equivalent of using the key sequences 'cmd+c' - which is not acceptable.

Thankfully iTerm2, supports remapping of modifier keys as well, so for iterm2 I reversed them again which means iTerm2 recognizes command as command and control as control.

So problem solved for now.

Was it helpful?

Solution

The command-key shortcuts do not generate actual input for your terminal, so they are not represented in any way. Terminal allows you to bind certain key combinations to produce actual input (in Preferences > Settings > Keybaord), but you don't get the choice of a Command modifier for them.

OTHER TIPS

Type this in your bash shell :

stty ctlecho

then hit Command

That will display what you need.

To go back to normal

stty -ctlecho

If it doesn't work, try a combo.

Example with Ctrl+C

$ stty ctlecho
$ ^C
$ stty -ctlecho
$ 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top