5

Is it possible to set up Terminal to launch a new window by default? I recently came from running Ubuntu and I normally open hundreds of terminals a day. It's a pain to have to always right-click on the shortcut and select "New Window". If I could use Spotlight and have it open a new window instead of giving focus to the existing window, it would speed things up a lot.

3
  • How many windows do you usually have open? Can you re-use any of them?
    – Cajunluke
    Commented Sep 21, 2011 at 18:50
  • This question could be clearer. What do you mean by "by default"? By default when you do what? Terminal normally opens a new terminal window when you open it for the first time, for example. What do you mean by "the shortcut"? Are you referring to the Terminal application icon in the Dock?
    – Chris Page
    Commented Sep 22, 2011 at 4:36
  • If you mean that you want Terminal to create a new terminal window whenever you click on its Dock icon, I suspect that could be annoying to some people, because there'd be no way to bring Terminal to the front without creating a new terminal window.
    – Chris Page
    Commented Sep 26, 2011 at 13:57

3 Answers 3

3

If you want to have a means to quickly open a new Terminal window whether or not Terminal is already open, and whether or not it is the active application, you could use an AppleScript "applet" to do so. By placing the applet in the Dock, you can click on it to open a new Terminal window.

This script will create a new Terminal window:

tell application "Terminal"
    activate
    do script
end tell

To create an applet containing this script from the command line:

osacompile -o "New Terminal Window.app" -e 'tell application "Terminal"' -e 'activate' -e 'do script' -e 'end'

To reveal it in Finder so you can drag it to the Dock:

open -R "New Terminal Window.app"
1
  • Thanks. Note: it's better to not use spaces in the applet name "New Terminal Window.app" -> "NewTerminalWindow.app" so that you can inject applet name in custom script without problems with quotes(like Karabiner script). Now every time you run: open -a NewTerminalWindow.app - a new terminal window will be opened Commented Mar 6 at 9:08
2

Not precisely the answer you asked for, but when Terminal is open, hitting Command-N will open a new window. Also, the first set of Terminal preferences (Settings tab, the "On startup, open:" buttons might be useful to play with.

2

You can create a AppleScrip with this command:

open -n /Applications/Utilities/Terminal.app

And add a global shortcut to call this script ;)

3
  • Or, even better, set up an Automator application to call the AppleScript.
    – zpletan
    Commented Sep 21, 2011 at 20:53
  • If it's already open, that will merely bring Terminal to the front, but won't create a new terminal window. I believe the question is how to have it create a new terminal window.
    – Chris Page
    Commented Sep 26, 2011 at 13:56
  • @zpletan Scripts wrapped as Automator apps or services are often slower. And arguably less convenient to edit and manage than regular files.
    – Lri
    Commented Sep 26, 2011 at 15:08

You must log in to answer this question.

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