How to set up tmux so that it starts up with specified windows opened?

satoru picture satoru · Apr 10, 2011 · Viewed 188.2k times · Source

How to set up tmux so that it starts up with specified windows opened?

Answer

Amjith picture Amjith · Apr 22, 2011

You can write a small shell script that launches tmux with the required programs. I have the following in a shell script that I call dev-tmux. A dev environment:

#!/bin/sh
tmux new-session -d 'vim'
tmux split-window -v 'ipython'
tmux split-window -h
tmux new-window 'mutt'
tmux -2 attach-session -d

So everytime I want to launch my favorite dev environment I can just do

$ dev-tmux