Activate Mac OS X’s Terminal using a keyboard shortcut

Word on the street is that those little hacky but oh-so-useful tidbits known as InputManagers do not work in the upcoming Mac OS X 10.6 (“Snow Leopard”). Apple has been threatening to remove support for these since Mac OS X 10.5 was announced so it’s no surprise that this day may have finally come.

Unfortunately, if this is true it means the death of a lot of really useful add-ons, such as Ecamm’s iSight plugin iGlasses, hetima’s insanely useful Safari enhancement SafariStand, and Mike Solomon’s application patching mechanism SIMBL (which in itself allows developers to “hijack” applications to add more functionality as a kind of hack-enabler).

A SIMBL plugin I use all the time is Visor, developed by Nicholas Jitkoff. Visor patches Apple’s Terminal to make it available system-wide via a hotkey (ala Quake’s console window). With Visor, you hit a pre-determined keyboard shortcut and voila, a Terminal window slides into view.

I use the shit out of this all the time, and if Mac OS X 10.6 truly does kill InputManager support my muscle memory will be downright achy-breaky. So I set out to roughly duplicate this functionality using a method that should continue to work in future OS updates.

Luckily, Applescript seems to be a usable solution, albeit just slightly less responsive than Visor was (and without the slick “slide out” effect). That said, this script still works well enough for my purposes and may fit your workflow as well.

Download the Open Terminal Window script (posted June 9, 2009, version 1.0)
  1. Download the disk image from the link above and mount it.
  2. Move the resulting Open Terminal Window.scpt file into your home library’s Scripts folder (/Users/username/Library/Scripts/). There’s a shortcut in the disk image that should work.
  3. Now we need some freeware assistance to assign a keyboard shortcut to run the script. Download Red Sweater’s free Fastscripts Lite application (direct download link), mount the disk image, and copy the FastScripts Lite application into your applications folder.
  4. Launch the FastScripts Lite application. It’ll appear in your menu bar (the icon looks like a scroll). Click on the FastScripts Lite icon and select Preferences from the FastScripts Lite submenu:

    FastScripts

  5. Select the Script Shortcuts tab and double-click the (None) text beside the Open Terminal Window.scpt item. Now you can set a quick key that will run this script. I use control+option+command+0 (zero).
  6. That’s it! Now you can close the FastScripts Lite window and try out your quick key. Assuming you didn’t choose one that conflicts with an existing system-wide keyboard short cut you should see the Terminal application launch and a new window activate. You also will probably want to add FastScripts Lite to your startup items so it launches when you log in.

This script should be smart enough to detect if there is a Terminal window currently open and will reuse it if the window isn’t busy doing something (running top, viewing a man page, etc.). If the current window is busy, the script will open a new tab.

I haven’t tested this that much but it works perfectly for me. Leave feedback in the comments if you run into issues, or if it’s working for you.

Comments

1 | egghat said on June 10, 2009 3:55 AM

I use Quicksilver for stuff like this.

You can add global triggers (keyboard shortcuts) with Quicksilver and assign it to almost every action you can start with Quicksilver. And starting an application is definitly possible with Quicksilver.

Post a reply to this comment
2 | Neil replies: (June 10, 2009 10:38 AM)

Word on the street is that Quicksilver is completely broken in 10.6, alas.

Post a reply to this comment
3 | Grover said on June 10, 2009 10:43 AM

The developer of Quicksilver went to work at Google and basically started over from scratch, resulting in the Google Quick Search Box. cmd + cmd > t brings up terminal for me (though that won't make up for your lost muscle memory).

Post a reply to this comment
4 | egghat said on June 10, 2009 11:05 AM

Hmmm. I hope this will change until September. A Mac without Quicksilver feels like Windows 98 to me :-(

Post a reply to this comment
5 | Mike Harris said on June 30, 2009 5:09 PM

Wow. If Snow Leopard will adamantly not run Visor or Quicksilver, I'm not likely to upgrade, and given that I am a bit of a "have to have the newest!" person, that's an unusual statement to come from me.

Post a reply to this comment
6 | Mike Harris said on June 30, 2009 9:21 PM

The one thing which I find that your script doesn't replace for me is that my "muscle memory" learned to hit the same activation key to dismiss the pop-down terminal as well. I think I could probably solve that with my macro application -- "if Terminal is frontmost application, [activation key] should quit Terminal."

Post a reply to this comment
7 | andy said on August 15, 2009 2:11 PM

The easier way to remedy this situation is to run Terminal in 32-bit mode rather than the default 64-bit mode:

Open Finder and navigate to /Applications
Ctrl+Click on Terminal.app and select Get Info
Check the box next to 32-bit mode and close the Info dialog

Relaunch Terminal and your SMBL plugins should work again.

Post a reply to this comment
8 | Ken Collins said on August 18, 2009 12:36 PM

I just got the latest visor working with Snow Leopard. Details here http://www.metaskills.net/2009/8/18/visor-terminal-on-snow-leopard

Post a reply to this comment
9 | Ken Collins Author Profile Page said on August 22, 2009 9:13 AM

I just got the latest visor working with Snow Leopard. Details here:

http://www.metaskills.net/2009/8/18/visor-terminal-on-snow-leopard

Post a reply to this comment
10 | Abhi Beckert said on September 2, 2009 1:06 AM

QuickSilver runs perfectly fine on Snow Leopard, and has been running fine in all the developer previews that I used.

My replacement for Visor:

* Control-Return opens Terminal (as a global trigger in quicksilver)

* OS X Spaces configured to show Terminal in all spaces

* Use the existing Command-H facility to "get out of" terminal

This is working out well for me so far, i just need to get used to not using Command-Return to close terminal.

Post a reply to this comment
11 | sean said on November 2, 2009 7:53 AM

I use LaunchBar instead of QuickSilver or the Google one - it's not free, but it's worth it.

Post a reply to this comment

Post a comment

Remember Me?

Comments Preview:

Comments:

(Textile text-formatting is enabled - HTML will be stripped out):


ISSN 1499-7894
Recent Posts
SEARCH
Contact Archives Web Love Writing Photos FAQs Home