3

If I want to send a command to a running pane in tmux I can do this:

tmux send -t foo ls ENTER

I figured I could do something like this to do the same but in a new pane:

tmux send ls ENTER

Is there an easy way to run in a pane?

Philip Kirkbride
  • 249
  • 2
  • 10
  • 30

1 Answers1

4

It is easy to run a command in a new pane, simply:

tmux new-window your command ENTER

The issue is that the window is destroyed once the command finishes. Therefore, "tmux new-window ls ENTER" makes no sense. In contrast, "tmux new-window top ENTER" or "tmux new-window watch ls ENTER" seem much more reasonable.

Lungang Fang
  • 181
  • 3
  • 1
    FWI, if you get to this page wondering how to split the existing window, use the command `tmux split-window your command ENTER` – Spencer Mar 20 '20 at 18:19