run or send a command to a tmux pane in a running tmux session
- by cjroebuck
I want to write a shell script which will attach to a named tmux session, select a window (or pane) in that session and run a command in that selected window (or pane).
How do I do this from a bash script?
I know tmux new-window -n:mywindow 'exec something' allows you to send commands to a freshly created window. But I need something like tmux select-window -t:0 'my command'
I suppose I could use send-keys but seems like their should be something that takes a command or list of commands that get run.