Skip to main content
2 of 3
added 837 characters in body
meuh
  • 54.7k
  • 2
  • 70
  • 139

It's not too clear what layout you are looking for, but here is a demo bash script that may provide you with some ideas. One problem is that select-layout even-vertical will remove any column structure you have developed, and place all the panes vertically. So the approach here is to first create the vertical structure of rows, equalise their spacing, then split each pane horizontally. This image shows the result. The text shown in each pane is just a hint as to the real command you would run there, and the aa bb cc are just a simplified pod_name from your code. Each pane is titled with the pane_index which changes all the time, and the %pane_id which does not.

xterm tmux layout Here is the bash script, which shouldn't be too exotic for MacOS, but you'll have to try for yourself.

#!/bin/bash session_uuid=mysession DISPLAY=:0 xterm -title ttmux -geometry 60x30-1+1 \ -e "tmux new-session -s $session_uuid 'sleep 20'" & sleep 2 tmux set -g pane-border-status bottom tmux set -g pane-border-format "#{pane_index} #{pane_id}" declare -a names for pod_name in aa bb cc do names+=($pod_name) done declare -A pane_ids for pod_name in ${names[@]} do tmux split-window -v -t "$session_uuid" "echo kubectl logs '$pod_name';sleep 999" pane_ids[$pod_name]=$(tmux display -p '#{pane_id}') done tmux kill-pane -t "$session_uuid:0.0" tmux select-layout even-vertical # removes columns! for pod_name in ${names[@]} do pane_id=${pane_ids[$pod_name]} tmux split-window -h -t "$pane_id" "echo 'Second Column' $pod_name;sleep 999" tmux display-panes done 
meuh
  • 54.7k
  • 2
  • 70
  • 139