Powerline: Powerline broken with Tmux 2.0

Created on 7 May 2015  路  6Comments  路  Source: powerline/powerline

The powerline status line seems to break after TMUX 2.0 update. Any ideas how to fix this?

1___zsh_tmux_plugin_run__tmux__and_new_issue_ _powerline_powerline

My .tmux.conf is --

set -g status-right '#(/Users/subho/.powerline/scripts/powerline tmux right)'
source '/Users/subho/.powerline/powerline/bindings/tmux/powerline.conf'

And my powerline.conf is --

if-shell 'env "$POWERLINE_CONFIG_COMMAND" tmux setup' '' 'run-shell "powerline-config tmux setup"'
# vim: ft=tmux
ctmux bug

Most helpful comment

For others who find this: It took me a while to realize what to do to fix this, but it's already fixed here, so I just had to update powerline and everything worked again!

For me that was pip install --upgrade --user powerline-status

All 6 comments

Was going to post the same. However, this seems to be an issue with tmux, not powerline. You can for example :source ~/.tmux.conf again or just :source /Users/subho/.powerline/powerline/bindings/tmux/powerline.conf inside tmux. This will activate powerline again. For some reason it doesn't work with the initial reading of the .tmux.conf.

@burningTyger @ssbanerje you can temporarily solve this problem by adding the following lines at the end of your .bashrc (or .zshrc):

# Put this line at the end of .bashrc or .zshrc
# The path can be whatever path you installed powerline in...
tmux source "/usr/local/lib/python3.4/site-packages/powerline/bindings/tmux/powerline.conf"

@burningTyger @ssbanerje actually I just figured out that for some reason tmux no longer executes the source command inside its ~/.tmux.conf at startup anymore. So to fix this problem, you can simply remove (comment out) the source command from ~/.tmux.conf:

# source "/usr/lib/python3.4/site-packages/powerline/bindings/tmux/powerline.conf"

and add the following lines to your .zshrc (or .bashrc) after tmux -2 command has been issued:

# Put these lines after the tmux startup command

if [[ -f /usr/lib/python3.4/site-packages/powerline/bindings/tmux/powerline.conf ]]; then
    tmux source "/usr/lib/python3.4/site-packages/powerline/bindings/tmux/powerline.conf"
fi

(remember to replace the powerline path above with the actual powerline installation path in your computer) :dancers:

@phongvcao I do not see tmux not executing source command. But it for some reason stopped executing set-environment -r (actually this command never did anything useful like it is described in the documentation) and refresh-client during configuration loading (they are executed via shell, not present in configuration file). Since almost all environment variables are added by using set-environment -g VAR val then set-environment -r VAR this stops at first environment variable effectively neitralizing powerline-config tmux setup.

Maybe in place of sourcing tmux configuration files I should now execute them from shell line-by-line (or using cmd1 \; cmd2), expanding environment variables on my own (should actually make startup faster by lessening number of tmux calls).

For others who find this: It took me a while to realize what to do to fix this, but it's already fixed here, so I just had to update powerline and everything worked again!

For me that was pip install --upgrade --user powerline-status

Try using source-file instead of source in your .tmux.conf

Was this page helpful?
0 / 5 - 0 ratings