A small fish script to make an auto-tiled tmux terminal with specified commands.
It’s hacky, but it works:
function gzxh
if test (count $argv) = 0
return 1
end
set session (tmux new-session -d -P -F '#{session_name}' $argv[2])
for cmd in $argv[3..-1]
tmux split-window -t "$session:{start}.{bottom}" $cmd
if test $status != 0
tmux select-layout -t $session $argv[1]
tmux split-window -t "$session:{start}.{bottom}" $cmd
end
end
tmux select-layout -t $session $argv[1]
tmux attach -t $session
end