1

Is there a way to configure iTerm2 preferences from the command line? I am specifically looking to automate setting the Key preferences, for instance configuring escape codes to be sent when certain key combinations are pressed. I am using a script similar to https://mths.be/macos for other osx automation.

Thanks!

1

Is there a way to configure iTerm2 preferences from the command line?

Technically, it's possible. Your keybinding are held in your profile which is accessible in ~/Library/Prferences/com.googlecode.iterm2.plist. To write custom profiles you will have to...

  • Convert to XML (plutil -convert xml1)
  • Make your changes
  • Convert back to Binary (plutil -convert binary1)

(I highly suggest making backups of your original .plist before doing this.)

This will require some due diligence and reverse engineering on your end to ensure you're adhering to the XML structure for iTerm as this isn't documented anywhere.

An alternative to this would be to look at Dynamic Profiles within iTerm2

  • This is definitely a great answer; by storing the dynamic profile in source control I can just download and apply it on the command line, when I provision a mac. Thanks! – mikewaters Feb 4 '18 at 21:08

You must log in to answer this question.

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