Sitelet https://web.archive.org/web/20201209102147/https://github.com/powerline/powerline/issues/2019
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

Autohide host name if in tmux #2019

Open
cmpute opened this issue Aug 2, 2019 · 2 comments
Open

Autohide host name if in tmux #2019

cmpute opened this issue Aug 2, 2019 · 2 comments

Comments

@cmpute
Copy link

@cmpute cmpute commented Aug 2, 2019

Is there any option to auto hide host name in shell within remote tmux session? I found it a little duplicate to show host name in both tmux status line and shell prompt. Thanks

@weavage
Copy link

@weavage weavage commented Aug 9, 2019

I was wondering the same thing today. See if this hack works for you. Tmux sets two environment variables inside the session: TMUX and TMUX_PANE. I used TMUX_PANE, but I think either would work. Powerline supports config overrides via environment variables. Taking advantage of TMUX_PANE, POWERLINE_CONFIG_OVERRIDES, and a custom shell theme (without the hostname segment), I was able to throw this in my .bashrc file:

# Change theme if inside TMUX
if [[ -n "${TMUX_PANE}" ]]
then
  export POWERLINE_CONFIG_OVERRIDES='ext.shell.theme=tmux_default'
fi

Change 'tmux_default' to whatever you name your custom theme and put this section before your call to powerline-daemon. Might need to tweak it a bit if you're not using bash.

@cmpute
Copy link
Author

@cmpute cmpute commented Aug 9, 2019

@weavage Thanks for the solution! I guess it would work for me! Nevertheless I still hope that there's an option to enable this is the segment settings :)

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.