Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is it possible to redirect an app in Mac OS X to another app?

If not, can you redirect Terminal.app to iTerm.app, so every app that wants to open a Terminal window, instead opens an iTerm window.

For example when something runs:

  • tell application "Terminal" in AppleScript
  • open -a Terminal
  • open -a /Applications/Utilities/Terminal.app
  • /Applications/Utilities/Terminal.app/Contents/MacOS/Terminal
  • open -b com.apple.terminal
  • etc.

Examples when this happens:

  • BBEdit: Clicking "Run in Terminal"
  • Alfred: Creating a shell-extension and toggle "Silent" off and run it
share|improve this question
1  
Which app wants to open Terminal.app? –  slhck Aug 5 '11 at 20:24
    
When something runs tell application "Terminal" in applescript, when something runs open -a Terminal, open -a /Applications/Utilities/Terminal.app, /Applications/Utilities/Terminal.app/Contents/MacOS/Terminal or open -b com.apple.terminal etc etc... –  Tyilo Aug 5 '11 at 20:28
    
May I ask why? You cover probably all cases I could think of, but in order to do that, you'd need to effectively "turn" Terminal.app into iTerm.app, either by changing the Info.plist file located within Terminal.app (read more about that here). Or just move the Terminal executable away and replace it with iTerm's executable. Don't know if that will work as expected though. –  slhck Aug 5 '11 at 21:03
2  
To be honest, I've never seen any program opening a Terminal so far. Everything you mentioned above involves manually opening, so it shouldn't be hard to change these lines to iTerm2 (which is different from iTerm, by the way). Can you be a bit more specific, maybe? I still don't know which use case you are talking about. –  slhck Aug 5 '11 at 21:15
1  
@slhck I surely hope that Apple would prevent (by checksums, codesigning and sandboxing) replacing Terminal´s executables with other code! And I totally agree, I´ve never seen other .apps open Terminal; only .command files could be an issue, but you can change the "open with…" assignment there. –  Asmus Aug 6 '11 at 11:37

1 Answer 1

up vote 5 down vote accepted

As said in the comments above, you won't be able to change that on a large scale basis. Applications calling Terminal.app will do that by calling its Bundle identifier, com.apple.terminal. You'd have to change this to "fake" the Terminal and redirect to another one. Is that's possible? I highly doubt so.

This means that every application calling Terminal will have a setting for the bundle identifier used. Some will probably have that hardcoded, others should allow changing it, either through Preferences or through a preference list setting.


How to make BBEdit use another Terminal

For BBEdit, that's relatively easy according to the release notes. This is for version 8.7 though, and I can't find it in the "Experts Preferences" of version 10 anymore. Maybe they've removed the feature.

defaults write com.barebones.bbedit Misc:TerminalBundleIDOverride "com.googlecode.iTerm2"

Just replace com.apple.Terminal with the bundle identified of the other terminal emulator, e.g. com.googlecode.iterm2 for iTerm2.

A similar entry can be found on secrets.blacktree.com, although it doesn't appear to be working (I've never seen a -bundleid datatype in defaults).

The best idea would be to bring up a support request with BBEdit's developers.


How to make Alfred use another Terminal

Alfred's shell extensions use the terminal emulator you specify, according to the help.

You can select to use the OS X Terminal.app or iTerm, as well as your prefix for Shell commands in the Alfred preferences.

enter image description here

It didn't work for me at first, so I had to delete iTerm.app, delete Alfred and its preferences/caches, then reinstall iTerm2. This is explained in the Alfred support forums.

share|improve this answer
    
Isn't it supposed to be defaults write com.barebones.bbedit Misc:TerminalBundleIDOverride "com.apple.Terminal" ? (Removed p and straighten quotes) Neither with or without "p" it didn't work in BBEdit 10, but with Alfred I just had to change it in the Terminal / Shell dropdown –  Tyilo Aug 6 '11 at 14:41
    
Whoops, copy/paste error. Doesn't appear to be working anymore (see edits above). –  slhck Aug 6 '11 at 15:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.