Automatic Profile Switching should work for jobs with arguments
Thanks for filing an issue! Please answer the questions below so I can help you.
- iTerm2 version: 3.4.3
- OS version: macOS Big Sur 11.1
Automatic Profile Switching (APS) with job name trigger only works if the job name itself matches. This becomes a problem when one wants to switch a profile when launching any shell script, Python script, Java process, etc.
Detailed steps to reproduce the problem:
- Create a shell script named
foobar.sh
- Create an APS trigger
&foobar.sh
for any profile - Run
./foobar.sh
What happened: The profile is not switched. ps -ax | grep foobar
shows that the process is actually bash foobar.sh
--- the foobar.sh
string is an argument to the process name.
What should have happened: The profile should be switched while foobar.sh
is running.
This can also be reproduced for any Python script (the process will be named python
instead of bash
above), and any Java process (process will be named java
).
My humble suggestion is that the trigger syntax be modified to:
&"bash foobar.sh"
&"java * sbt-launcher.jar *"