zellij
zellij copied to clipboard
Zellij run multiple panels in background
Don't know how to word this, so. I would like to be able to start X amount of panes in the background and then attach to that session.
Example script:
#!/usr/bin/env bash
set -xeu
SLEEP_DURATION="1s"
ZELLIJ_SESSION="test-zellij"
COUNTER=0
zellij kill-session "${ZELLIJ_SESSION}" && zellij delete-session "${ZELLIJ_SESSION}"
sleep "$SLEEP_DURATION"
zellij attach -bc "${ZELLIJ_SESSION}"
sleep "$SLEEP_DURATION"
until [ "${COUNTER}" -gt 5 ]; do
zellij -s "${ZELLIJ_SESSION}" run --name "panel ${COUNTER}" -- yes
COUNTER=$((COUNTER + 1))
sleep "${SLEEP_DURATION}"
done
zellij attach "${ZELLIJ_SESSION}"
Currently this results in
I'm not 100% sure what you're trying to do, but you might want to take a look at layouts: https://zellij.dev/documentation/layouts
Message ID: @.***>Right, so I'm trying to spawn multiple processes with the run command whilst not being attached to the session. This currently fails if I'm not in the session. If I'm in the session and use the until loop then it starts all the yes processes.