2

I've built a script that sits in the users login items that runs each time a user logs in but I want to prevent the terminal window or terminal application from popping up. I don't mind the app icon showing up in the dock but I have some users who tend to want to close the terminal window which cancels what the script is doing.

I've been googling this and there doesn't seem to be a simple solution. Checking "Hidden" in the login items does not hide the window.

Thank you

  • Why is your script firing Terminal? What kind of script are you using? – daniel Azuelos Jan 21 '16 at 17:50
1

You could run your script using the screen utility. This will detach the program from the terminal so even if it is closed the program execution will continue.

Screen will exit once the program running in it has finished but not before.

  • I've never heard of a "screen utility" before. Looking over your link now to see how I apply this to the script. Not really sure how. – Carter Jan 21 '16 at 17:03
  • @Carter you just type screen before your command. But really launchd is the way to go. – Matt Sephton Mar 4 '18 at 0:14
0

Instead of having Terminal.app launch a .command file (I assume), you should set up a LaunchAgent. It will run a command or a script with no user visibility.

  • 1
    This is how I would do it, but you should describe how to do that. If someone doesn't know what a LaunchAgent script is, they probably don't know how to create one either. – blm Jan 21 '16 at 19:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .