Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Powerline broken with Tmux 2.0 #1354

Closed
ssbanerje opened this issue May 7, 2015 · 6 comments · Fixed by #1355
Closed

Powerline broken with Tmux 2.0 #1354

ssbanerje opened this issue May 7, 2015 · 6 comments · Fixed by #1355

Comments

@ssbanerje
Copy link

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
@burningTyger
Copy link

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.

@phongvcao
Copy link

@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"

@phongvcao
Copy link

@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) 👯

ZyX-I added a commit to ZyX-I/powerline that referenced this issue May 8, 2015
@ZyX-I
Copy link
Contributor

ZyX-I commented May 8, 2015

@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).

ZyX-I added a commit to ZyX-I/powerline that referenced this issue May 8, 2015
Should make it not needed to bother with environment variables. Makes tmux 
configuration more fragile.

Is a different variant of fixing powerline#1354. Does not conflict with the previous one, 
so both are kept.
ZyX-I added a commit to ZyX-I/powerline that referenced this issue May 10, 2015
Should make it not needed to bother with environment variables. Makes tmux
configuration more fragile.

Is a different variant of fixing powerline#1354. Does not conflict with the previous one,
so both are kept.
@NHDaly
Copy link

NHDaly commented Sep 24, 2015

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

@roddykou
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants