new-session 'compass watch /path/to/project1/compass/' \; \
split-window 'compass watch /path/to/project2/compass/' \; \
new-session command (which creates a new
tmux session) and the
split-window command (which splits the current window into two panes) in
tmux takes optional shell commands to run. The
detach-client does the obvious at the end.
If you want a horizontal split (two panes side by side), use
split-window -h in the command above.
When sending multiple
tmux commands to
tmux you need to separate them by
; needs to be protected from the shell by quoting/escaping it (
\;), to stop the shell from interpreting it as the end of the
I've split the whole thing into separate lines for readability. If you do this in a script (which I recommend), make sure there's nothing after the final
\ on each line.
Reattach to the session with
tmux attach, or
tmux attach-session (these are all equivalent).
tmux session will end once both commands have finished executing.