Question

I am iTerm2 (1.0.0) user. I know how to create profiles, by using iTerm settings or modifying com.googlecode.iterm2.plist file.

For convenience, I will use .plist to indicate com.googlecode.iterm2.plist file.

There are some profiles already to connect my dev server using a command. (i.e. ssh 192.168.1.1).

I want to modify and add more profiles to iTerm. So, I wrote a Python script to do this. The procedure is like below.

  1. Convert iTerm2 .plist file to .xml. (i.e. plutil -convert xml1)
  2. Write several profiles to this file using plistlib in Python.
  3. Convert iTerm2 .plist file to binary format that as it was. (i.e. plutil -convert binary1)

The procedure above doesn't work. iTerm2 didn't load my profiles created from my Python script.

So, I checked if there is no .plist file, how iTerm load the profiles.

  1. I quit the iTerm2 program.
  2. I deleted the .plist file from my disk, which is located at ~/Library/Preferences/.
  3. Run iTerm2 program.
  4. open Profile Setting by typing ⌘ Cmd+O.

I found there are profiles even if I deleted the .plist file. What happened here? Is there any backup profiles file which I don't recognize?

Was it helpful?

Solution

Preferences are cached in 10.9. See http://hints.macworld.com/article.php?story=20130908042828630. If you edit a plist file directly or replace the plist of an application, the application will keep using the cached version even after you quit and reopen the application.

You can run defaults read com.googlecode.iterm2 or killall cfprefsd to apply the changes:

  1. Quit iTerm
  2. Edit the plist
  3. Run defaults read com.googlecode.iterm2 or killall cfprefsd
  4. Open iTerm

Changes made with defaults are applied after you just quit and reopen an application like in earlier versions of OS X.


OTHER TIPS

Having great trouble migrating iTerm2 (2.0.0) plist to my new Mac running Yosemite (10.10.1). What I did to fix that is:

  1. Open iTerm2, so a default com.googlecode.iterm2.plist file is created.
  2. Quit iTerm2
  3. Deleted all cached preferences for iterm2 by issuing defaults delete com.googlecode.iterm2
  4. Copied the file to the new Mac in the correct location inside Preferences folder, so I had my old profiles and settings back
  5. Read in the prefs file with defaults read -app iTerm
  6. Open iTerm2 and was happy to have profiles and window arrangements on my new Mac
Licensed under: CC-BY-SA with attribution
Not affiliated with apple.stackexchange
scroll top