0

I am spawning a child process with node, which is an external application on OSX. The problem is that this external application appears BEHIND the terminal window. I want this application to appear in the front, on top.

My code looks something like this:

var spawn = require('child_process').spawn,
    process = spawn('myApp');

The application launches, but it does not show up to the user because it's behind the terminal window. I want it to be in front.

drj
  • 533
  • 2
  • 16
  • Does [this question](http://stackoverflow.com/questions/7779454/mac-os-x-bring-gui-applications-to-foreground-when-launched-from-the-command-li) help? – Chris Aug 01 '16 at 07:03
  • @Chris thanks for sending that one over. I played with this a bit and found that it opened a terminal window and executed the application. The terminal window is somewhat undesirable and I was not able to do a SIGINT kill on the child application once it disappeared, which is needed. I'll continue to play with the options, though. – drj Aug 01 '16 at 15:48
  • "open -a" worked, but I'm still not able to kill the app from my node script... – drj Aug 01 '16 at 15:54
  • I resolved by spawning "killall", which should work for our application. – drj Aug 01 '16 at 17:13

0 Answers0