6

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?

1

1 Answer 1

5

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.

2
  • 2
    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, 2020 at 18:19
  • tmux split-window -d your command here will also return input point to the current pane
    – scrutari
    Sep 1, 2023 at 9:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .