The Wayback Machine - https://web.archive.org/web/20200529150041/https://github.com/gpakosz/.tmux/issues/179
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

display local command or ssh hostname in window format #179

Open
divansantana opened this issue Aug 11, 2018 · 3 comments
Open

display local command or ssh hostname in window format #179

divansantana opened this issue Aug 11, 2018 · 3 comments
Labels

Comments

@divansantana
Copy link

@divansantana divansantana commented Aug 11, 2018

Now that #178 is sorted, a separate much more minor issue 馃槵

How does one achieve something like this:

1 htop 2 remotehost1 3 remotehost2 4 zsh

IE display the command if local, else display the ssh hostname. This almost works.

tmux_conf_theme_window_status_format='#I #W #{hostname_ssh}'
tmux_conf_theme_window_status_current_format='#I #W #{hostname_ssh}'

The above results in something like this which is a little less ideal because of screen estate:

1 htop 2 ssh remotehost1 3 ssh remotehost2 4 zsh
@gpakosz
Copy link
Owner

@gpakosz gpakosz commented Aug 11, 2018

$ tmux setw automatic-rename-format '#{?pane_in_mode,[tmux],#{?#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_tty} true #D),#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_tty} true #D),#{pane_current_command}}}#{?pane_dead,[dead],}'

This mostly does what you want but

  • is overkill
  • sometimes lags behind

I'm not sure how to achieve it efficiently for now

@divansantana
Copy link
Author

@divansantana divansantana commented Aug 11, 2018

@gpakosz Cool this is minor. It doesn't really bother me too much.

Thanks!

@gpakosz gpakosz added the enhancement label Aug 16, 2018
@gpakosz
Copy link
Owner

@gpakosz gpakosz commented Sep 14, 2018

Hi @divansantana

The following should be less heavy

tmux setw -g automatic-rename-format "#{?pane_in_mode,[tmux],#{?#{m:*ssh,#{pane_current_command}},#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_tty} true #D),#{pane_current_command}}}#{?pane_dead,[dead],}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can鈥檛 perform that action at this time.