Normally I work in Windows or Linux. Currently, I am working on an iMac. Rather than fighting years of muscle memory, I switched the Command and Control keys in the Keyboard preferences. Problem is now Control keys in iTerm don’t work. After some research I determined how to send Control characters with both Command and Control.

Note: I know this could use some screenshots. No time right now.

Here is how to make Control-C work in iTerm when Control/Command have been switched:

  1. In the iTerm menu, go to Bookmarks->Manage Profiles.
  2. Click Keyboard Profiles->Global.
  3. Add a new mapping.
  4. In the Key field: Select hex code, and enter the ASCII code for lower case ‘c’: 0x63
  5. In the Modfier field: Check the box for Command.
  6. In the Action field: Select send hex code and enter the ASCII code for Control-C which is 3, also known as ETX or End of Text.
  7. Check the box for High interception priority.
  8. Click OK.

Some common ASCII Key Control Hex Codes for Terminal and pico/nano use:

  • CTRL-C: 3 (ETX)
  • CTRL-X: 18 (CAN)
  • CTRL-D: 4 (EOT)
  • CTRL-K: B (VT)
  • CTRL-O: F (SI)

A list of Control keys and their ASCII equivalents is available at: http://www.cs.tut.fi/~jkorpela/chars/c0.html

A list of all 7-bit ASCII characters: http://www.neurophys.wisc.edu/comp/docs/ascii/ascii-printable.html