Doh. Try this.

Index: cmd-pipe-pane.c
===================================================================
RCS file: /cvs/src/usr.bin/tmux/cmd-pipe-pane.c,v
retrieving revision 1.19
diff -u -p -r1.19 cmd-pipe-pane.c
--- cmd-pipe-pane.c     29 Mar 2011 19:30:16 -0000      1.19
+++ cmd-pipe-pane.c     28 Jul 2011 07:49:16 -0000
@@ -55,11 +55,9 @@ cmd_pipe_pane_exec(struct cmd *self, str
        char                    *command;
        int                      old_fd, pipe_fd[2], null_fd;
 
-       if ((c = cmd_find_client(ctx, NULL)) == NULL)
-               return (-1);
-
        if (cmd_find_pane(ctx, args_get(args, 't'), NULL, &wp) == NULL)
                return (-1);
+       c = cmd_find_client(ctx, NULL);
 
        /* Destroy the old pipe. */
        old_fd = wp->pipe_fd;




On Wed, Jul 27, 2011 at 09:35:16PM -1000, Jason Axelson wrote:
> Yes it looks like I missed that .0. But for some reason :consumer.0
> isn't working for me for send-keys so I've changed all the commands to
> use the index of the window instead of the name.
> 
> When I run the script this is the output I get:
> $ ./test.sh
> rm: cannot remove `/tmp/wait': No such file or directory
> cat: /tmp/wait: No such file or directory
> 
> Here is the updated script:
> 
> #!/bin/bash
> session="scenario1"
> 
> rm /tmp/wait
> 
> tmux new-session -d -s $session
> 
> tmux new-window -t ${session}:1 -n 'consumer'
> tmux pipe-pane -t ${session}:1.0 'cat > /tmp/wait'
> sleep 1
> tmux send-keys -t ${session}:1.0 "echo build" C-m
> sleep 2
> tmux pipe-pane -o -t ${session}:1.0
> 
> cat /tmp/wait
> 
> 
> On Wed, Jul 27, 2011 at 9:22 PM, Nicholas Marriott
> <nicholas.marri...@gmail.com> wrote:
> > Are you sure you shouldn't be doing "send-keys -t ${session}:consumer.0" as 
> > well?
> >
> >
> >
> > On Wed, Jul 27, 2011 at 07:10:59PM -1000, Jason Axelson wrote:
> >> Hi,
> >>
> >> I seem to be having some trouble understanding how pipe-pane should
> >> work. It seems like it will only capture output if the pane is
> >> currently selected by a client? So the following doesn't work (also
> >> attached as a script):
> >>
> >> #!/bin/bash
> >> session="scenario1"
> >>
> >> rm /tmp/wait
> >>
> >> tmux new-session -d -s $session
> >>
> >> tmux new-window -t ${session}:1 -n 'consumer'
> >> tmux pipe-pane -t ${session}:consumer.0 'cat > /tmp/wait'
> >> sleep 1
> >> tmux send-keys -t ${session}:consumer "echo build" C-m
> >> sleep 5
> >> tmux pipe-pane -o -t ${session}:consumer.0
> >>
> >> cat /tmp/wait
> >>
> >>
> >> Instead I expect the cat /tmp/wait to output "build" and then my prompt.
> >>
> >> What am I missing? Maybe there's a better way to capture the contents
> >> of a window?
> >>
> >> By the way, I really enjoy tmux, and scripting it is really enjoyable.
> >>
> >> Thanks,
> >> Jason
> >
> >
> >> ------------------------------------------------------------------------------
> >> Got Input? ? Slashdot Needs You.
> >> Take our quick survey online. ?Come on, we don't ask for help often.
> >> Plus, you'll get a chance to win $100 to spend on ThinkGeek.
> >> http://p.sf.net/sfu/slashdot-survey
> >
> >> _______________________________________________
> >> tmux-users mailing list
> >> tmux-users@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/tmux-users
> >
> >



------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to