When I launch a non-command-line application from Terminal.App, it always seems to go behind whatever Terminal.App window I’m running. I noticed this for OpenGL and X11 based applications and also for more native applications like Xee. Is there some preference I’m missing? If there’s a way so that I can launch these applications and shift focus to them by default? That would be great. Often, these programs run from Terminal.App and keep open stdin/stdout/stderr on Terminal.App (i.e., they run via an interpreter like Python). So I don’t think I can just script it with Butler or something (someone mentioned Butler? via Google). I basically just want to fork and give focus to the child process — would that mean I’d have to hack Terminal.App? Is that even possible (is it open source)?
Hopefully I’m missing something.
How do you open a non-command-line application from Terminal.app?
open /Applications/TextMate.app (you can use
open with any app or file, just give the path) TextMate started and focus shifted from Terminal to TextMate.
-g option will open the app in the background.
If you want to launch a python script:
$ python script.py
To run an application:
$ open -a textmate
Yes, application name is case insensitive. If you want to run that script in a separate windows, use Shift+Command+N, type the command and check “Run command in a shell”