The only way to tell Terminal to make windows is with AppleScript.
That said, there is a shell command that will run AppleScript. It's called 'osascript'.
https://developer.apple.com/library...rwin/Reference/ManPages/man1/osascript.1.html
Since you didn't say what OS version you're using, you'll have to experiment with AppleScript. That's because different OS versions have different Terminal versions, and different Terminal versions have different scripting vocabularies. The following examples were tested on OS X 10.8.4. I don't know what other OS versions they'll work on.
Start by opening AppleScript Editor, then open Terminal's scripting dictionary. It's in the File menu, the Open Dictionary... menu-item. Refer to that as you read the following.
After some web-searching and experimenting, it seems the simplest way to tell Terminal to open a new window is this:
Code:
tell app "Terminal" to do script ""
Copy and paste that into AppleScript Editor, then run it. Terminal should open a new window. If you run it again, it should open another window.
Here's the 'osascript' equivalent of that one-liner:
Code:
osascript -e 'tell app "Terminal" to do script ""'
Copy and paste this one line into an existing Terminal window. A new Terminal window will open and come to front each time you paste it.
The result of
do script is a reference to the new window. So run this script in AppleScript Editor:
Code:
tell application "Terminal"
set _target to do script ""
get name of (current settings of _target)
end
The first line stores the resulting reference in a variable named _target. The second line gets the name of that window's current settings set. To understand all the properties in a settings set, refer to Terminal's scripting dictionary, under the description for settings set.
Here's another script that lists all your settings sets:
Code:
tell application "Terminal"
set _sets to every settings set
repeat with _set in _sets
set _name to name of _set
log "name: " & _name
end repeat
end
Look at the events & Replies in AppleScript Editor, so you can see everything listed.
For the next script, I first went into Terminal and made a new settings set in the Preferences window called "Big_Brew", which is a duplicate of "Homebrew" with a larger font. Do that BEFORE running the script, otherwise there won't be a settings set to apply. Then try this script:
Code:
tell application "Terminal"
set _brew to first settings set whose name is "Big_Brew"
tell front window to set current settings to _brew
end
The front window's appearance will change to "Big_Brew", showing that a new appearance can be applied to a window that's already open
Each of the above scripts illustrates one small part of the overall result you want to achieve. For example, I show how to open new windows, how to refer to a specific settings set, and how to apply a known settings set to a window. Now you get to experiment with AppleScript Editor and the 'osascript' command in Terminal, and build up smaller parts to make either an AppleScript app or a .command file that does what you want. If you're not interested in that process, then just use MacVIM. It needs less experimentation.