3

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.

2 Answers 2

3

How do you open a non-command-line application from Terminal.app?

Using 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.

Applying the -g option will open the app in the background.

1
  • cool. thanks. that works for *.app apps (e.g., open ~/xee_dev/Xee.app). any ideas about how to launch interpreter-based applications though? (i.e., open /usr/bin/python script.py doesn't seem to work. i guess i could create a .app directory or something....) thx again tho
    – Tom Harada
    Oct 6, 2009 at 19:13
2

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"

You must log in to answer this question.