Last Updated: February 25, 2016
· wojtekkruszewsk

Change iTerm2 profile from the terminal

Assuming iTerm has a profile named "Evening":

echo -e "\033]50;SetProfile=Evening\x7"

Or choose profile via argument:


echo -e "\033]50;SetProfile=$1\x7"

./profile DarkMode

In Vim you can add command to change Vim color scheme and iTerm profile at the same time (assuming iTerm has a profile named "Dark"):

command Dark  colorscheme solarized | set background=dark  |                          silent !printf '\e]50;SetProfile=Dark\x7'