Tmux ignores first splitw command in .tmux.conf

set -g history-limit 50000
new -s ds -n WindowName Command
neww -n foo/bar foo
splitw -h
splitw -h
splitw -v
splitw -v

This is my tmux.conf file. I start it by using tmux attach. It does everything I want it to do, but it ignores the very first splitw command regardless of whether or not it's a splitw -h or splitw -v.

I'd like to understand why this is happening and anything I can do to fix it.

1 Answer

I ended up doing this. You can run this .tmux.conf with just tmux. It kills the extraneous session created by running the command tmux (which aliases to tmux-session).

set -g history-limit 50000
new -s ds -n estruct
selectw -t ds
splitw -v
splitw -h
splitw -h
#Switch to the "ds" session (defaultSession) and then kill the extra one
send-keys "tmux switch-client -t ds" C-m
send-keys "tmux kill-session -t 1" C-m
send-keys "clear" C-m
#Move to each individual panels and run commands as though you're there, C-m submits them as though you've hit enter
selectp -t 0
send-keys "tmux resize-pane -D 20" C-m
send-keys "tmux resize-pane -D 10" C-m
send-keys "sci" C-m
send-keys "clear" C-m

I know this is a really "bad" approach, but I find tmux's behavior extremely complex and incomprehensible. This gives me a very simple interface to getting my relatively simple environment setup in a straightforward way.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like