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 > >
test.sh
Description: Bourne shell script
------------------------------------------------------------------------------ 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