Is there a keyboard shortcut to alternate between color schemes in iTerm2

Solution 1:

This works on iTerm2 (version, 3.0.8 through 3.0.13)

  1. In iTerm's preferences, select the keys tab.
  2. There's a table called key mappings
    • click on the + at the bottom of the table
  3. Choose a keyboard shortcut
  4. From the dropdown menu, choose the load color preset option
  5. You'll get another dropdown menu to choose the color preset you want

Keys Tab]([https://i.stack.imgur.com/oJ8p1.png)

It works across all panes and windows and its setting is persistent across sessions.

Solution 2:

I found another solution from this site:

Declare a function in your .bashrc or .zshrc: it2prof() { echo -e "\033]50;SetProfile=$1\a" }

Then you can switch profile from CLI with it2prof ProfileName

Solution 3:

Note: This is not a complete solution, since it isn't entirely keyboard based, but it's the fastest method I have found to switch between color schemes. Hopefully others find it useful.

  1. Create a profile for each color scheme you want to use (iTerm -> Preferences -> Profiles)
  2. Switch between profiles in your current session (Command-I or View -> Edit Current Session)

One keyboard chord and one mouse click.