I couldn't get that to work, so I went ahead and patched tmux to expand
format sequences contained within shell special sequences.  Here's the patch
<https://gist.github.com/staticfloat/9e58c9a479a9f541cc6c>, not sure if the
coding style is appropriate but hopefully if this is something that is
desirable for mainline tmux it can be altered easily.
-E


On Tue, Jul 15, 2014 at 2:31 AM, Nicholas Marriott <
nicholas.marri...@gmail.com> wrote:

> Either use random junk or the session name but set status-right
> individually to a different command for each session
>
>
>
> -------- Original message --------
> From: Elliot Saba <staticfl...@gmail.com>
> Date: 15/07/2014 07:08 (GMT+00:00)
> To: Nicholas Marriott <nicholas.marri...@gmail.com>
> Cc: tmux-users@lists.sourceforge.net
> Subject: Re: Passing session name to external command in status bar
>
>
> Thanks, I was just debugging this right now.  ;)
>
> By "set a different status-right", do you mean I need to have the actual
> command itself be different?  E.g. if I put some pseudo-random junk in my
> command that I later ignore, tmux will treat them as separate jobs?  Or is
> there a better way?
> -E
>
>
> On Tue, Jul 15, 2014 at 2:05 AM, Nicholas Marriott <
> nicholas.marri...@gmail.com> wrote:
>
> > What happens is that one session runs "~/tmuxtest.sh" and the second
> > sees it has been run and uses the same result. This is because they are
> > seen as the same job, because jobs are global. I don't think you will be
> > able to get this to work without changing tmux to either process formats
> > in the command before running it, or to treat jobs for different clients
> > as entirely separate. Alternatively set a different status-right for
> > each session when you create it.
> >
> >
> > On Mon, Jul 14, 2014 at 12:38:39PM -0400, Elliot Saba wrote:
> > >    Unfortunately, that doesn't seem to work. **I'm testing via the
> > following:
> > >
> > >    Put this in my .tmux.conf:
> > >    set -g status-right '#(~/tmuxtest.sh)'
> > >    set -g status-interval 1
> > >
> > >    Put this in ~/tmuxtest.sh:
> > >    #!/bin/sh
> > >    tmux display-message -p "#S"
> > >    Then open up two separate tmux sessions, and you will see that the
> > >    display-message**command is just using the latest session created;
> > which
> > >    is the default behavior of tmux when it has no explicit session
> > >    information, I believe.
> > >    -E
> > >    On Mon, Jul 14, 2014 at 9:57 AM, Nicholas Marriott
> > >    <[1]nicholas.marri...@gmail.com> wrote:
> > >
> > >
>
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to