You would first start a session:
tmux new-session -s [session-name] -n [first-tmux-screen-name] -d
We can now separate this window in sections by using splitw options:
tmux splitw -h
tmux splitw -v
we can select a section too:
tmux selectp -t0
tmux splitw -v
And depending on what we want to display, or run in each nested window, we use the send-key option. If we want to add a new window to this tmux session we can use this command:
tmux new-window -n [name-of-new-window] -t [session-name]
zsh works for me:
#!/bin/zsh
tmux new-session -s test -n four-screen -d
tmux splitw -h
tmux splitw -v
tmux selectp -t0
tmux splitw -v
After your run the script: zsh scriptname.zsh then attach to the session: tmux attach