I have a question similar to this guy https://stackoverflow.com/questions/5609192/how-to-set-up-tmux-so-that-it-starts-up-with-specified-windows-opened but more specific.
I want to do this in a single tmux.conf file, without any key-bindings to load specific sessions per @jasonwryan 's answer.
So, how do I do this? I set my tmux.conf:
new -s mySession -n myWindow neww -n foo/bar foo splitw -v -p 50 -t 0 bar selectw -t 1 selectp -t 0
but it doesn't split the window when I start tmux.
Update: I don't think the attach is working. If I ditch the second 'foo' window and simplify my tmux.conf :
# set panes the way I want them # if I started tmux by just running 'tmux' in command line, it automatically creates session(0) so... new -s mySession -n myWindow # ... create new session (1) with new window (0) select-window -t myWindow # select myWindow (0) splitw -v -p 50 -t myWindow # split myWindow (0) vertically into halves(50 percent) attach -s mySession # error usage: attach-session [-dr] [-t target-session] attach-session -t mySession # so this doesn't work either switch -t mySession # nor doesn't work
So what am I missing? If I manually switch sessions once tmux launches by doing CTRL+b s and then selecting the mySession, the panes are split and everything is great. So how do I attach to or switch to mySession from session(0)?