GNU Screen has a command called exec that will launch a subprocess and optionally let you do things with its file descriptors, including tying them in your window. I frequently use :exec !! sx -b /tmp/file to send a file over a serial link using the xmodem protocol.

I'm looking for the same functionality in tmux so I can move away from screen without having to use minicom's (or picocom's, etc,) function for sending files.


Run tmux


Go to the command mode in your tmux session:

ctrlB then :

Then split a new window with a command associated.

split-window -d 'exec sx -b /tmp/file' 

Option -d is optional, it is to detach from the new pane and to return to the first. That will works with new-window command too.

CtrlB then o will switch from one pane to the other.

I didn't tested it with sx, but it worked with exec top


Take a look at tmux's respawn-window command and http://hyperpolyglot.org/multiplexers

  • 1
    I don't know how I could use that to accomplish my goal. I want to dump stdout from a command into a window, and dump the window's output into stdin of the command. – Shawn J. Goff Aug 29 '12 at 15:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.