You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to change status line based on ssh connection, but I can't get the conditional working. First of all, I think the example in readme has incorrect variable name, shouldn't #{?#{pane_ssh_connection},ssh,no-ssh} be #{?#{pane_ssh_connected},ssh,no-ssh}?
But anyway, neither of those seem to work. They both just always display "no-ssh". And I've also tried just #{?pane_ssh_connected,ssh,no-ssh} but same result. The #U and #H interpolation work correctly, I can see the user and hostname of my ssh connection, but the conditional still displays "no-ssh". If I just put #{pane_ssh_connected} in the status, I see 1 when ssh is connected and nothing when no ssh connection. But still the conditional is not working.
Am I missing something here? I'm fairly new to tmux so I've not used the conditionals before.
I'm running tmux 2.9 on Ubuntu.
The text was updated successfully, but these errors were encountered:
Yea, I can send a PR if I get it working. But don't have any idea ATM what to do to it, everything I have tried failed. I'm not familiar with casting to boolean in tmux conf.
@cvuorinen I think you need to make sure it's quoted properly in the format string. For example, the following works just fine for me:
set -g status-left '#{?#{pane_ssh_connected},ssh,no-ssh}'
One other thing I've found out the hard way is that format strings (like status bars) can use the conditional. You apparently can't use tmux conditionals for formatting (e.g. set -g window-style).
I would like to change status line based on ssh connection, but I can't get the conditional working. First of all, I think the example in readme has incorrect variable name, shouldn't
#{?#{pane_ssh_connection},ssh,no-ssh}
be#{?#{pane_ssh_connected},ssh,no-ssh}
?But anyway, neither of those seem to work. They both just always display "no-ssh". And I've also tried just
#{?pane_ssh_connected,ssh,no-ssh}
but same result. The#U
and#H
interpolation work correctly, I can see the user and hostname of my ssh connection, but the conditional still displays "no-ssh". If I just put#{pane_ssh_connected}
in the status, I see1
when ssh is connected and nothing when no ssh connection. But still the conditional is not working.Am I missing something here? I'm fairly new to tmux so I've not used the conditionals before.
I'm running tmux 2.9 on Ubuntu.
The text was updated successfully, but these errors were encountered: