I start GNU Parallel with --tmux which will start a tmux window per job.
I would like to join all windows as panes with the size nicely distributed between them (like tiled view: C-b M-5).
I tried doing:
seq 15 | parallel tmux -S /tmp/tmsF8j3K joinp -s {} -t 1
But it does not distribute the height evenly resulting in:
create pane failed: pane too small
Is there a way to tell a window to distribute height evenly when joinp
ing or a way to join all windows as panes and then tile them? Maybe something using select-layout tiled
?
Edit
I am using this as the test program:
seq 1000 | parallel --jobs 9 --tmux sleep
The goal is to have the 9 running jobs shown in a nice 3x3 window when attaching to tmux. When one job dies it should be replaced by the next job.
I have tried:
while [ -e "$SERVER" ] ; do
top=$(tmux -S $SERVER new-window -P -n all)
tmux -S $SERVER list-panes -a | grep -v "^$top" | cut -d':' -f1-2 |
while read p ; do
tmux -S $SERVER joinp -s $p -t $top
tmux -S $SERVER select-layout tiled
done
tmux -S $SERVER kill-pane -t $top
tmux -S $SERVER select-layout tiled
sleep 1
done
But it still gives:
can't find pane X
And it does not keep all windows as panes in the first window when attaching.
tmux
version are you using? Theafter-
hooks may help, but those aren't in the newest release yet. – JigglyNaga Aug 18 '16 at 09:32sleep
example because the dead jobs hang around for a couple of seconds. – JigglyNaga Aug 18 '16 at 13:36