Pipe directly to a Tmux pane

5,906

This approach will work if processes were in panes ie. you see there output inside panes not in background

First you have to know the particular pane pts , use this command :

ps ax | grep $$ | awk '{ print $2 }'

The output will be like pts/5

Then we redirect the output of desired precesses pane to this pts 5

tmux pipe-pane -o -t 0.2 'cat > /dev/pts/5'; \
tmux pipe-pane -o -t 0.3 'cat > /dev/pts/5'; \
tmux pipe-pane -o -t 0.4 'cat > /dev/pts/5'; 

-o for open new pipe , -t for target-pane

Share:
5,906

Related videos on Youtube

Filip Dupanović
Author by

Filip Dupanović

A colorful individual apt in the use of technology for social progress; exerting passion for people—hardly ever flabbergasted by anyone's occasional demotion from rationale; oft loves sharing great new comedic material in the ongoing joke… Feel free to make the best use of snippets I post, just be careful! Thank you 🙇: 3D5R7qtd7RR1qrc6JokiNSRbSit5Yg671h

Updated on September 18, 2022

Comments

  • Filip Dupanović
    Filip Dupanović over 1 year

    I've been looking at the available Tmux commands and I can see, out of the box, that I can pipe output from a pane elsewhere or write to the terminal assigned to the session.

    I would like to have background processes A, B and C all piping their output to a particular pane in a particular session. How could this be arranged?