81

I would like to set iTerm2 instead of terminal.app as my default terminal.

Go2Shell for example let you open a terminal to the current directory in Finder. I want to ba able to use iterm2 instad of terminal.app.

I didn't find any answer on the official documentation.

Thanks for your help.

Update: ShellTo is a great alternative to Go2Shell and supports iTerm2

3
  • Default terminal for what? You just launch the one you want and leave the other alone...? Please explain in more detail what you're asking.
    – Daniel Beck
    Jan 17, 2012 at 11:21
  • 1
    Go2Shell blurb from the app store: Added support of iTerm, iTerm 2 and even xterm :). Just take a look at its preferences. Also, at least for Terminal.app, this feature has been part of the OS for half a year, see here (last item).
    – Daniel Beck
    Jan 17, 2012 at 11:43
  • Oh I didn't saw it. My fault!
    – politicus
    Jan 17, 2012 at 12:08

9 Answers 9

76

Terminal.app declares itself a handler of the ssh, telnet and x-man-page URL schemes.

It also registers the file extensions .term (sessions), .terminal (settings), .tool and .command (scripts), and itself as an editor/viewer for these.

Other than that, there is no default terminal in OS X. It's just an application that can handle URL schemes and file types.


iTerm is capable of handling all of these except the Terminal.app specific .term/.terminal.

For the file types, just open the Get Info dialog and associate all files of this kind with iTerm. For the URL schemes, you can download and install the preference pane Default Apps and change the association there. You can also use it as an alternative method of changing the file type associations.

enter image description here


All of these settings are user specific and stored in ~/Library/Preferences/com.apple.LaunchServices.plist. You can of course edit it in a suitable editor yourself. It's pretty straightforward. Screenshot of Xcode 4 showing the result of changing x-man-page in Default Apps preference pane:

enter image description here


Terminal.app also provides the following Services for other applications:

  • New Terminal at Folder
  • New Terminal Tab at Folder
  • Open man page in Terminal
  • Search man pages in Terminal

The association with Terminal.app is hard-coded. You need to create your own Services e.g. using Automator and/or AppleScript to replace these.


If Terminal is used via its AppleScript API, there is no way to just replace it with iTerm in all cases, as their APIs are quite different. This will often require substantial changes to the programs or scripts doing that.

6
  • 2
    Thank you for your amazing answer. Clear, very informative. New to OSX, I didn't know Default Apps.
    – politicus
    Jan 17, 2012 at 12:19
  • Awesome tool. Glad it still works well under El Capitan.
    – ifwdev
    Jan 9, 2016 at 14:42
  • Oh goodness, this is so helpful. I accidentally deleted Terminal.app (or screwed it up so bad it won't open) and this works to fix that, and my React Native builds are using iterm so far so good, knock on wood. THX:D Jun 14, 2018 at 20:35
  • SwiftDefaultApps is a more recent alternative to RCDefaultApp.
    – hawk
    May 16, 2022 at 6:13
  • if you are a React Native developer coming here to find out how to get the React Native launcher to run the metro server in iTerm instead of Terminal, see this post
    – gabe
    Oct 25, 2022 at 17:02
90

You should be able to make iTerm.app your default terminal by selecting "Make Default" from the menu bar.

File menu drop down

Alternatively you can use a keyboard shortcut.

+++\

2
  • 2
    It doesn't seem to work for most of my tests. GitHub.app still opens Terminal and so does SublimeText.
    – fregante
    Mar 26, 2016 at 6:45
  • 7
    @bfred.it: Sadly, the name of the menu item is misleading: the only thing it does is to run shell scripts opened from Finder in iTerm2 rather than Terminal. It will not magically cause third-party applications such as GoShell, GitHub, Alfred, ... to use iTerm2, as explained in Daniel Beck's answer.
    – mklement0
    Sep 11, 2016 at 22:07
11

As found on the ma.ttias.be blog, iTerm2 can register itself as the default terminal for some common URL schemes: You just have to check the corresponding schemes at the very bottom of the General tab in the current Profile from iTerm preferences

iTerm > Préférences > Profiles > Général > URL Schemes

1
  • 1
    Most to the point answer IMO.
    – markus
    Jun 10, 2017 at 13:06
10

To provide a pragmatic summary of the existing answers:

  • macOS (OS X) does NOT support the concept of a default terminal.

    • See Daniel Beck's helpful answer for background information.
    • iTerm2 itself somewhat misleadingly offers a menu item named iTerm2 > Make iTerm2 Default Term (as presented in halfcube's answer), but the only thing that does is to make Finder run shell scripts opened from it in iTerm2 (more specifically, it assigns the shell role of UTI public.unix-executable to Finder) - which is not a typical use case.
  • Therefore, applications must be configured INDIVIDUALLY to use iTerm2 instead of Terminal, IF they support that:

    • While the Go2Shell app that prompted the OP's question does have a configuration dialog that supports iTerm2 (open -a Go2Shell -- config, the application doesn't seem to work at all as of OSX 10.11.6 (on clicking the toolbar button as of v2.23, the only thing that ever happens is that the configuration dialog comes up, even after having clicked Install Go2Shell to Finder).
    • The paid alternative mentioned by the OP - application ShellTo - also supports iTerm2 in principle, but as of this writing doesn't support the current version, v3+.
7

As mentioned in the comments above Go2Shell can be told to use iTerm2

To open configuration window follow this steps:

  1. Fire up your favorite terminal program.
  2. Enter: open -a Go2Shell --args config
  3. Press [return].

enter image description here

http://zipzapmac.com/Go2Shell

1

What @gef posted was partially what I did. However, this is what worked for me.

Open your terminal app:

open -a Go2Shell --args config

Then on the options copy the following code, you might have to right click and paste as the commands are restricted:

cd %PATH%;clear;pwd;open -a iTerm.app .;killall Terminal;

And voila, the terminal app should open give a new parameter to iTerm, then close itself again.

1

You can run any command once the terminal application is run so in order to run iterm2 instead of terminal application, you can create a script that runs each time the terminal is opened and this script should open iterm and kill terminal app

Steps to create script

  • Vi /Applications/run_iterm.sh
  • Copy the following commands and paste them in the scrip

    #! /bin/bash
    open -a iTerm.app
    killall Terminal
    
  • Save the file

  • Chmod 755 /Applications/run_iterm.sh

Now our script is ready, the last step is to run it each time the terminal application is opened Run terminal Go to preferences -> General -> shell open with -> select command "complete path" and paste /Applications/./run_iterm.sh inside the textbook finally close the terminal application and run it again enter image description here

1
  • 2
    Wow; configuring a program to automatically kill itself whenever it is started.  What could possibly go wrong?   :-(   ⁠ Sep 16, 2017 at 1:47
0

This thread was for OS X Lion, and seems out-of-date for El Capitan. However, since I found this page while searching for a way to have XCode launch iTerm instead of Terminal, I thought I'd post my solution.

It's not free, unfortunately, but it can be done using the Magic Launch system preference app. Using that tool, I set iTerm as the default app for .term, .terminal, and .command extensions. That did the trick for my needs.

Hope this helps!

2
  • Can you expand upon how this software works? Please see How to recommend software.
    – Burgi
    Oct 12, 2016 at 9:29
  • Are you saying my answer doesn't work anymore for El Capitan? Could you clarify?
    – Daniel Beck
    Nov 18, 2016 at 13:19
0

To associate whatever type of protocol, ssh,telnet, or even ftp and others to iTerm2 you go to iTerm2 application, choose: Menu ITerm2 / Preferences / Url Schemes ; Select ssh Url Schemes

Note that now if you go to your browser (say Chrome or Firefox) you can now open an ssh:// link type using iTerm2 instead of the default terminal app.

1
  • 1
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Feb 2, 2022 at 16:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .