separate custom preferences for duplicate iTerm2 apps?

100 views
Skip to first unread message

Eric Katerman

unread,
Mar 3, 2021, 7:20:58 AM3/3/21
to iterm2-discuss
Hi there--

I've been using iTerm2 for years and I'm a big fan-- thank you to the iTerm2 team!!

I work with python and recently I started setting up some development environments on an m1 mac. Since many python packages aren't yet available for arm64, I decided to create two iTerm2 apps, one called "iTerm" and the other called "iTerm Rosetta" (which runs under Rosetta emulation). I'd like to use separate preferences for each of my two iTerm's (for example, I'd like to use bash in iTerm Rosetta and zsh in iTerm). I'm familiar with the `General > Preferences > load from custom folder` option in iTerm preferences, but my attempts at keeping these separated between the two apps seems futile since as I understand the location of this file is loaded from the default iTerm preferences plist (~/Library/Preferences/com.googlecode.iterm2.plist).

So: is it possible to maintain separate custom preferences for duplicate iTerm2 apps? (Or more generally, is there a better path to setting up virtual envs for not-yet-arm64'ed python code in iTerm?) I'd like to take advantage of m1 stuff when possible, and creating two iTerms (one of which runs via Rosetta) seemed like a clean way to do that, but I'd love to learn about other solutions!

Thanks in advance,
Eric

Adrian Bool

unread,
Mar 4, 2021, 4:16:37 PM3/4/21
to iterm2-...@googlegroups.com
Hi Eric,

Looks like you can...

Edit the "iTerm Rosetta/Contents/Info.plist"; updating the following section, from:

<key>CFBundleIdentifier</key>
<string>com.googlecode.iterm2</string>

To something like:

<key>CFBundleIdentifier</key>
<string>com.googlecode.iterm2rosetta</string>

If you then run "iTerm Rosetta" it will crash due to the above file no longer matching the app's signature.

You can get past that issue by renaming the "_CodeSignature" file in the "iTerm Rosetta/Contents" folder to something else, e.g.  "ORIGINAL_CodeSignature".

Running "iTerm Rosetta" should now should now be successful.

With the new identifier set; "iTerm Rosetta"'s configuration is taken from "~/Library/Preferences/com.googlecode.iterm2rosetta.plist" — giving you the separation you desire.

Of course, you're dropping a security control with the above hack... Up to you as to whether that is acceptable to you or not.

Cheers,

aid


--
You received this message because you are subscribed to the Google Groups "iterm2-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iterm2-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/iterm2-discuss/8947b1c1-07c2-42bf-bd6c-b0e56d90b63cn%40googlegroups.com.

Eric Katerman

unread,
Mar 5, 2021, 1:27:45 PM3/5/21
to iterm2-discuss
Hi aid!

Thanks very much for this idea! I tried what you suggested and at first it didn't seem to work for me-- probably worth mentioning that I'm on Big Sur 11.2.2 and iTerm2 3.4.4-- but after making your suggested changes and reverting a few times, my desired setup seems to be working now, even with the original name of the folder _CodeSignature in iTerm Rosetta/Contents. Unfortunately I'm not sure I can reproduce exactly the steps that I followed to achieve the desired result, but your ideas definitely pointed me in the right direction, thanks!!

Best,
Eric
Reply all
Reply to author
Forward
0 new messages