Hello all, I have updated to the master branch of tmux.
I have now put setw -g pane-border-format "#P [#(echo $HOST)]" in my ~/.tmux.conf But it is still not working as I expect. The $HOST value used is the one in the terminal from where I launched tmux. Now if in a pane, I ssh to a different machine, the env var HOST in that pane would be the name of that new machine. But the pane border status still shows the old HOST. Is it possible to make the pane border status 'live update' in any way? Thanks. On Mon, Sep 28, 2015 at 1:48 PM Kaushal Modi <[email protected]> wrote: > I'd like to add that different panes in the same window can be on > different hosts. As I switch panes, the left status should update based on > the actual value of $HOST env var in that pane. > > > -- > Kaushal Modi > > On Mon, Sep 28, 2015 at 1:45 PM, Kaushal Modi <[email protected]> > wrote: > >> Here's a use case. >> >> Let's say I am on abc.def.xyz.com domain to being with. >> I have below in my ~/.tmux.conf: >> >> set -g status-left "#(echo $HOST)" >> >> - If I do "echo $HOST" in the terminal (in tmux), I get "abc.def.xyz.com >> ". >> - Also I get "abc.def.xyz.com" in the left status. >> >> Now I do "ssh uvw". >> >> - "echo $HOST" returns "uvw.def.xyz.com" (CORRECT). >> - But the left status is still "abc.def.xyz.com" (INCORRECT). >> >> I would like that left status to update based on the actual $HOST env var >> and change as I use the "ssh" and "exit" commands. >> >> >> >> >> -- >> Kaushal Modi >> >> On Mon, Sep 28, 2015 at 1:20 PM, Micah Cowan <[email protected]> >> wrote: >> >>> On Mon, Sep 28, 2015 at 9:30 AM, Kaushal Modi <[email protected]> >>> wrote: >>> > >>> > Hi, >>> > >>> > How can I show the actual $HOST value in the left status? The #H and >>> #h do not work as they are the local host names. They are not very useful >>> to me as I usually ssh into different machines and it would be nice to >>> display the ssh'd machine's name (instead of the local host name, which is >>> always the same). >>> > >>> > I would like the left status to reflect the $HOST value as I ssh to a >>> different machine and exit out of it. >>> >>> I'm not 100% sure I understand what you mean, but if you mean that >>> $HOST is an environment variable set in the session by the ssh client >>> (it isn't something that's set by my openssh client, for me), you >>> should just be able to use #(echo $HOST) within the status options. >>> >>> But if you expect the environment variable to be updated across a >>> persistent tmux session that you re-attach to from various ssh >>> connections, the $HOST environment variable isn't going to be updated >>> in the tmux server each time you connect: only on the tmux server >>> startup. Even if you have HOST in your update-environment setting, >>> that only updates the session environment, whereas the shell executed >>> with #(...) is copied with the tmux server's global environment. In >>> order to update that, I suppose you'd have to arrange to run >>> >>> $ tmux set-env -g HOST "$HOST" >>> >>> _before_ attaching to the session. >>> >>> -mjc >>> >> >> > -- Kaushal Modi -- You received this message because you are subscribed to the Google Groups "tmux-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
