Launching Terminals

One difference xterm users will notice is that there is no obvious way to launch a new Terminal window from the command line. For example, Mac OS X has no equivalent to the following commands:

xterm &
xterm -e -fg green -bg black -e pine -name pine -title pine &

Instead, you can create a new Terminal window by typing ⌘-N or selecting File New Shell from the menu bar.

Tip

To cycle between open Terminals, you can press ⌘-Right Arrow or ⌘-Left Arrow, use the Window menu, or Control-click on the Terminal’s Dock icon to reveal a context menu of open Terminals. You can also jump to a particular Terminal window with ⌘-number (see the Window menu for a list of numbers).

You can customize startup options for new Terminal windows by creating .term and .command files.

.term files

You can launch a customized Terminal window from the command line by saving some prototypical Terminal settings to a .term file, then using the open command to launch the .term file (see “open" in Section 1.5.4, later in this chapter). You should save the .term file someplace where you can find it later, such as ~/bin or ~/Documents. If you save it in ~/Library/Application Support/Terminal, the .term file will show up in Terminal’s File Library menu.

To create a .term file, open a new Terminal window, and then open the Inspector (File Show Info, or ⌘-I) and set the desired attributes, such as window size, fonts, and colors. When the Terminal’s attributes have been set, save the Terminal session ...

Get Mac OS X for Unix Geeks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.