1.3.1.1. .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 (File
Save, or
-S) to a .term
file (for example, ~/Documents/proto.term). Now,
any time you want to launch a Terminal window from the command line,
you can issue the following command:
open ~/Documents/proto.term
TIP:
You can also double-click on
proto.term
in the Finder to launch a Terminal window. See
"bindkey" under Section 1.5.4, later in this chapter, for an example of binding a key
sequence to this command.
The .term file is an XML property list
(plist) that you can edit by hand or with the
Property List Editor application
(/Developer/Applications).[2] By default, opening
the .term file creates a new Terminal window.
You can configure the window so it executes a command by adding an
execution string to the .term file.
When you launch the Terminal, this string is echoed to standard
output before it is executed. Example 1-1 shows an
execution string that connects to a remote host via ssh
and exits when you log out.