soyuka / tmux-current-pane-hostname

Tmux plugin that enables displaying hostname and user of the current pane in your status bar.
MIT License
76 stars 23 forks source link

#H interpolation doesn't work if not connected to ssh #18

Open fitrh opened 3 years ago

fitrh commented 3 years ago

#U interpolation doesn't work, but other features like #H and #{pane_ssh_connected} works as expected

Configurations OS : Arch Linux TMUX : tmux 3.1c

fitrh commented 3 years ago

Found the solution, i don't use any kind of tmux plugin manager and split my configuration into several files, including my status bar, it's become a problem if this plugin sourced before the status bar, but if source after the status bar, it works.

fitrh commented 3 years ago

But, there were still a problem remaining, the #H interpolation doesn't work if it's not connected to ssh.

soyuka commented 3 years ago

Feel free to help into patching this if you have a solution

georgesamy commented 6 months ago

@fitrh Hopefully not too late.

the #H interpolation doesn't work if it's not connected to ssh.

Had the same issue (also on Arch). Looked into the code, found in scripts/shared.sh:94 the library depends on command hostname to find the hostname in case of no opened ssh connection.

The problem for me was that I didn't have the command installed. On arch I installed hostname using sudo pacman -S inetutils and it now shows the current hostname in case there's no open ssh connection.