Bastian Ballmann
Bastian Ballmann

Reputation: 361

Show pane in all windows in tmux

I wonder if I can configure a pane in tmux to appear in all windows.

Any hints how to do that?

Upvotes: 11

Views: 4920

Answers (3)

Here's a way to do this, but the mirrored panes will be read-only. There's the pipe-pane command which sends the pane's output to a command. You can have that command write the output to a file and then from the panes you want to mirror from, you can tail -f that file. Example:

# In source pane
tmux pipe-pane 'cat > /tmp/asdf'

# In the target pane (or another tmux session or terminal window)
tail -f /tmp/asdf

Upvotes: 6

Daniël W. Crompton
Daniël W. Crompton

Reputation: 3518

Of course this is possible, but you would need to run tmux inside a tmux pane.

+-------------+-------------+
| tmux pane 1 | tmux pane 2 |
|             |             |
|             |+-----------+|
|             || new tmux  ||
|             ||  session  ||
|             |+-----------+|
+-------------+-------------+

How to do it:

  1. start new tmux session
  2. split pane
  3. unset TMUX in pane 2 # this allows tmux in tmux
  4. start new tmux session in pane
  5. repeat 1-3
  6. run tmux attach -t <target-session> # this is opens the shared session

This does not work as easily if you are running wrappers for tmux, such as come with oh-my-zsh or tmuxinator. And there are probably many reasons you shouldn't do it, I just don't know any of them.

Upvotes: 6

Josh McGee
Josh McGee

Reputation: 300

no you can't configure a pane to be linked to every window in a traditional sense but you can use tmux's link-window functionality to achieve much of this effect. wrap it in a script or tmux session file to link it to many windows at once.

**edit

you will also want to use the join-pane feature.

Upvotes: 2

Related Questions