Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mac OS X: Bring GUI applications to foreground when launched from the command line

Tags:

terminal

macos

Is there a way to bring GUI applications to the foreground when starting them from within Terminal on Mac OS X? If I run

/Applications/TextEdit.app/Contents/MacOS/TextEdit

in Terminal, TextEdit opens in the background. This is quite annoying if you're using "make && ./run" when developing GUI applications.

like image 221
jnsg Avatar asked Dec 16 '22 08:12

jnsg


2 Answers

At least for TextEdit and similar GUI apps, open will work:

> open /Applications/TextEdit.app
like image 131
Matt Ball Avatar answered Feb 12 '23 11:02

Matt Ball


There seems to be even shorter variant:

> open -a TextEdit

like image 37
brablc Avatar answered Feb 12 '23 11:02

brablc