(The following assumes you use bash)
There is. Unfortunately both Powerline and iTerm2 want to stomp on your PS1 from within PROMPT_COMMAND. When you install Powerline, you put something like this in your .bashrc:
function _update_ps1() {
export PS1="$(~/powerline-shell.py $? 2> /dev/null)"
}
export PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND"
There are three problems here:
1. iTerm2 will put its initialization in either .bash_profile or .profile. For sanity's sake, make sure both your Powerline and iTerm2 initialization are in the same file.
2. Changing PS1 at runtime isn't supported by shell integration. Instead, you need to change $orig_ps1, like so:
export orig_ps1="$(~/powerline-shell.py $? 2> /dev/null)"
3. If your $PROMPT_COMMAND was empty originally then Powerline kind of makes a mess by leaving a trailing ;. Get rid of that since you probably didn't have a preexisting $PROMPT_COMMAND. The final script you want is this:
function _update_ps1() {
export orig_ps1="$(~/powerline-shell.py $? 2> /dev/null)"
}
export PROMPT_COMMAND="_update_ps1"
Make sure you have the latest shell integration code by reinstalling it (the very first version would stop on your existing $PROMPT_COMMAND, the latest does not).