Using Ctrl-Tab to switch between tabs in Mac Terminal.app

88

35

How can I make Ctrl-Tab and Ctrl-Shift-Tab switch between tabs in Terminal.app on a Mac (OS 10.4 and 10.5 specifically)? This is how I switch tabs in Firefox and Aquamacs, and Command-Shift-[ and Command-Shift-] is too awkward to me. I am aware of this related question:

How can I change the keyboard shortcut for switching tabs in Mac Terminal?

And hence the Keyboard Shortcuts section of the System Preferences, but the dialog box for Keyboard Shortcuts doesn't seem to accept Ctrl-Tab in the Keyboard Shortcut field. Is there a special keyboard sequence for inputting tabs (with modifiers) into a dialog box field on a Mac? Is there any other method that would allow me to customize Terminal.app in the way I desire?

dkee

Posted 2009-06-01T15:24:35.600

Reputation:

12Just for reference: Shift-Command-Left/Right Arrow also switch tabs. And in Mac OS X Lion 10.7, you can use a three-finger swipe to switch tabs – Chris Page – 2011-09-17T10:15:57.337

Answers

128

I just tried this under Snow Leopard and it worked beautifully:

  1. Open System Preferences => Keyboard
  2. Go to Keyboard Shortcuts
  3. Click on "Application Shortcuts" on the left
  4. Click the little "+" to add a program
  5. Navigate to Terminal (it's hidden in Applications/Utilities)
  6. For the Menu Title type "Show Next Tab" or "Show Previous Tab" ("Select Next Tab" and "Select Previous Tab" for Mavericks or older) (Also, these items will be different for languages other than English.)
  7. For the Keyboard Shortcut type Ctrl-Tab or Ctrl-Shift-Tab
  8. Click Add. You are g2g!

user13902

Posted 2009-06-01T15:24:35.600

Reputation: 1 281

23It's "Show Next Tab" and "Show Previous Tab" under Yosemite. But it's slower than using Command+Shift+Right or Command+Shift+Left for some reason (which, btw, makes me envy Linux users). – LoremIpsum – 2014-10-19T17:31:17.113

Not working for Yosemite :( – Siddharth – 2014-11-05T08:27:44.763

@Siddharth It works in Yosemite for me, using the tips from LoremIpsum above. And it's not slow at all btw. – knatten – 2015-01-23T09:45:48.207

@knatten thanks for the information. It seems that they have recently fixed it. I checked it now and it works for me too :) – Siddharth – 2015-01-24T09:56:55.667

This is a game changer for Mac users, thank you! – Matt Jensen – 2015-10-13T16:02:23.460

1In OSX El Capitan I don't see a way to navigate to Terminal inside the utilities folder to add it to the application shortcuts list. I wound up just moving the app into /Applications, which worked. – incandescentman – 2015-11-05T04:37:57.160

Still works on El Capitan! :-) – levininja – 2016-10-03T20:37:07.907

On El Capitan you need to use "Select Next Tab" and "Select Previous Tab" for the menu title – cmcginty – 2016-11-15T18:31:01.600

You++, Works on mountain lion too. – Matthew Rathbone – 2014-02-26T18:09:08.200

Cool, same to mavericks. – Vlad T. – 2014-06-13T17:56:31.570

20

  1. Select next (right) tab CMD + }

  2. Select previous (left) tab CMD + {

So you would need to do CMD + Shift + [ or ] for left and right respectively.

Brian

Posted 2009-06-01T15:24:35.600

Reputation: 591

1Why did Apple decide to assign such horrid shortcuts to such frequently needed commands? – Nikhil – 2016-05-24T10:03:56.393

7

Yet an addition to the answer above: The manual binding of shortcuts has changed in Yosemite from "Select Next Tab" & "Select Previous Tab" to "Show Next Tab" & "Show Previous Tab"

sua

Posted 2009-06-01T15:24:35.600

Reputation: 71

4

shift + command + arrow left/right works out of the box on Yosemite.

RyJ

Posted 2009-06-01T15:24:35.600

Reputation: 141

1

Okay so here is the only way I could figure out how to do it. First create the command you want to use system preferences but use a placeholder instead of tab since it wont let you insert the tab. Then open up com.apple.terminal.plist (most easily done with the plist editor) and go to the section NSUserKeyEquivalents and you should see the commands you created. Delete the placeholder and go to the edit menu and select special characters. The tab character is in the arrows section. It's an arrow pointing towards a vertical line. Its unicode value is 21E5. Once that is inserted save and quit and it should work! You could also do all of this in system preferences but you have to insert all the characters instead of typing them and I have no idea what their unicode values are.

By the way, I assume apple has at least a semi good reason for not allowing tab characters normally, so proceed with caution. A lot of global shortcuts use tab but ctrl-tab doesn't seem to be one of them so you're probably okay.

Alex.Bullard

Posted 2009-06-01T15:24:35.600

Reputation: 291

0

Use iTerm2. It is a terminal alternative that supports this keyboard shortcut out of the box.

spuder

Posted 2009-06-01T15:24:35.600

Reputation: 8 755

0

For yosemite: http://taiki.net/2014/11/osx-terminal-sck.html

As I do not have any reputation to just comment I had to copy the answer.

  1. Open System Preferences => Keyboard
  2. Go to Keyboard Shortcuts
  3. Click on "Application Shortcuts" on the left
  4. Click the little "+" to add a program
  5. Navigate to Terminal (it's hidden in Applications/Utilities)
  6. For the Menu Title type "Show Next Tab" or "Show Previous Tab" (these items will be different for languages other than English)
  7. For the Keyboard Shortcut type Ctrl-Tab or Ctrl-Shift-Tab

The difference with yosemite is... they changed from "Select X Tab" to "Show X Tab"...

Why?

Tobias Kopelke

Posted 2009-06-01T15:24:35.600

Reputation: 1