Default start-up commands in custom terminals

May 22, '01 02:25:14PM

Contributed by: ryo

Not sure if anyone has posted this hack, but...

If you use custom Terminals for various tasks such as one terminal to telnet or ssh, and one terminal to tail a log file, etc. you can edit the .term file for each custom terminal to keep the shell you'd like to use -and- to also start up any default program or script you'd like.

If you'd like to set custom terminals with custom commands and still use your default shell, read the rest of this hint.

[Editor's note: This is similar to a tip that has been previously published, but it's a nicer wayto accomplish the same objective, so I've published it as a new hint]

To set your custom terminal command, just open your saved terminal file, say 'Custom.term' for example, and find the key-value pair:

<key>ExecutionString</key>
<string></string>

and add whatever command you want the terminal to launch on start-up.

For example:
<key>ExecutionString</key>
<string>/usr/bin/ssh -l username remote.host.comn
</string>

(Note: replace 'n' with return to actually execute the command automatically )

I've seen other posts that recommend replacing the 'Shell' key in the .term file with the command you want executed, but that strips the shell out from under you - and I was having problems using ssh that way. With the 'ExecutionString' hack, you get the shell you want and the default start-up command you want

I use this hack along with others that have been posted here at 'Mac OS Hints' to set up several Terminals, each with different color schemes, Titles, and start-up commands - all using the shell I want, and all available from either the 'Library' menu in Terminal.app or from the dock

Terminal.app is fun stuff...

Comments (5)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20010522142514286