0

I have a "login item" which runs a short Perl script. It is a *.terminal file simply because I don't know how else to run a script as a login item (ie. there is no input or output). It works well, except for one thing: each time it runs, it creates a new copy of the Terminal profile. By now, I have about a hundred of them :-(

This doesn't seem to happen with my other *.terminal files, but there are two key differences and I don't know which one is responsible for the behavior:

  1. The others are not login items, I run them manually by double-clicking their icons.

  2. The others are bash scripts, not Perl scripts.

How can I prevent these new profiles? Again, I'm not married to Terminal - if there is a way to run a script at login time that doesn't involve Terminal, I prefer it.

-- Ian

6
  • What do you mean with Terminal profile?
    – nohillside
    Jul 11, 2022 at 15:59
  • @nohillside when you open the Preferences dialog in Terminal.app, you get to select among various "profiles", and you can create new ones. It's like a theme, but not only for UI but other settings as well.
    – q.undertow
    Jul 11, 2022 at 16:12
  • Ah, right. I assume the perl script starts with #!/usr/bin/perl or similar? Do things change when you create a bash script instead which then only runs exec /path/to/perl/script? Also, is there anything in the Perl script which interacts with Terminal?
    – nohillside
    Jul 11, 2022 at 16:15
  • The script starts with #! /usr/bin/env perl . Does nothing at all interactive. It's something I would do in a cron job if the Mac had a working/maintained cron :-P I haven't yet tried the bash oneliner angle but that is next, hopefully today.
    – q.undertow
    Jul 12, 2022 at 16:40
  • Cron still works :-)
    – nohillside
    Jul 12, 2022 at 17:23

1 Answer 1

-1

I worked around this by dropping Terminal.app from the picture entirely, something I already wanted to do even before. I created a fake Application with the Automator and put the Application into my Login Items. Before today, I didn't know this was possible - I had only created the other types of artifacts with Automator, and those can't be run standalone like this.

You must log in to answer this question.

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