Change Command+Period Keyboard Shortcut

keyboardshortcut

I would like to change the Terminal interrupt keyboard shortcut to ideally Command+Shift+C. Just this shortcut solely.

Is there a feasible way to do this?

Best Answer

The following was created, tested and works for me in macOS High Sierra.


Create the Automator service...

In Automator:

  1. File > New, or press: ⌘N
  2. Select Service and click the Choose button.
  3. Configure the settings as shown in the first image below.
  4. Add a Run AppleScript action.
  5. Replace the default code with the example AppleScript code.
  6. Save as e.g.: My Terminal Interrupt

enter image description here


Example AppleScript code:

tell application "System Events" to keystroke "c" using control down

Assigning the keyboard shortcut...

In System Preferences...

  • System Preferences > Keyboard > Shortcuts > Services add ⇧⌘C (press Shift-Command-C) to the My Terminal Interrupt service, as shown in the image below.

    • Note: A word about the shortcut you assign... ⇧⌘C is offered as a suggestion however, you'll need to select one that doesn't conflict with Terminal (or any other app that has focus if setting the service to any application) when pressed. This may require a strange combination or a four character combo. ⇧⌘C worked fo me in Terminal after changing the default for the Show Colors command, shown further below.

enter image description here


Terminal already uses ⇧⌘C for the Edit menu > Show Colors command, so you'll need to change that to e.g. ^⇧⌘C (Control-Shift-Command-C).

Changing the default keyboard shortcut...

  • System Preferences > Keyboard > Shortcuts > App Shortcuts

    1. Click the [+] button
    2. Change Application: from All Applications to: Terminal
    3. For Menu Title: type: Show Colors
    4. For Keyboard Shortcut: type, e.g.: ^⇧⌘C
    5. Click the Add button.

enter image description here

enter image description here


Now when in Terminal and I need to interrupt a running command, I press ⇧⌘C instead of ^C
(or ⌘.) to stop the process.