Hi Why not do this entirely in status_find_job?
On Tue, Jul 15, 2014 at 12:50:02PM -0400, Elliot Saba wrote: > The diff is available > > here:**[1]https://gist.githubusercontent.com/staticfloat/9e58c9a479a9f541cc6c/raw/c8ad7d9ad8486e8382c06fcb01865fd216010eb1/preexpand.diff > -E > > On Tue, Jul 15, 2014 at 12:32 PM, Nicholas Marriott > <[2]nicholas.marri...@gmail.com> wrote: > > Email me the diff > > -------- Original message -------- > From: Elliot Saba <[3]staticfl...@gmail.com> > Date: 15/07/2014 17:18 (GMT+00:00) > To: Nicholas Marriott <[4]nicholas.marri...@gmail.com> > Cc: [5]tmux-users@lists.sourceforge.net > Subject: Re: Passing session name to external command in status bar > > If I wanted to get this (or an improved patch) merged into mainline > tmux, where would I submit a pull request to? > -E > > On Tue, Jul 15, 2014 at 3:32 AM, Elliot Saba <[6]staticfl...@gmail.com> > wrote: > > I couldn't get that to work, so I went ahead and patched tmux to > expand format sequences contained within shell special sequences. > **[7]Here's the patch, 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 > <[8]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 <[9]staticfl...@gmail.com> > Date: 15/07/2014 07:08 (GMT+00:00) > To: Nicholas Marriott <[10]nicholas.marri...@gmail.com> > Cc: [11]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 < > [12]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][13]nicholas.marri...@gmail.com> wrote: > > > > > >**** > > References > > Visible links > 1. > https://gist.githubusercontent.com/staticfloat/9e58c9a479a9f541cc6c/raw/c8ad7d9ad8486e8382c06fcb01865fd216010eb1/preexpand.diff > 2. mailto:nicholas.marri...@gmail.com > 3. mailto:staticfl...@gmail.com > 4. mailto:nicholas.marri...@gmail.com > 5. mailto:tmux-users@lists.sourceforge.net > 6. mailto:staticfl...@gmail.com > 7. https://gist.github.com/staticfloat/9e58c9a479a9f541cc6c > 8. mailto:nicholas.marri...@gmail.com > 9. mailto:staticfl...@gmail.com > 10. mailto:nicholas.marri...@gmail.com > 11. mailto:tmux-users@lists.sourceforge.net > 12. mailto:nicholas.marri...@gmail.com > 13. mailto:nicholas.marri...@gmail.com ------------------------------------------------------------------------------ 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