On Sat, Mar 08, 2025 at 10:10:59PM -0800, Philip Guenther wrote:
> So, I've used screen for more than 30 years and have slowly been
> switching some of my usage of it to tmux.  I've switched my "need a
> bit of persistence on this host, maybe a couple windows" usages over
> and am now down to my "base" system.  Time to switch over the "open a
> bunch of windows at startup" setup.  And I can't figure out from the
> manpage WTH I need to do to achieve that.
> 
> In particular, my old .screenrc set a bunch of global stuff and then
> ended with a string of
>    screen -t local
>    screen -t pine alpine
>    screen -t lab ssh lab
>    screen -t one
>    screen -t two
>    screen -t three
>    screen -t bleys ssh bleys
> ...etc
> 

I run the following shell snippet via an @reboot crontab entry for
starting up a set of VMs and having of their consoles appear as
separate windows within the same tmux session. Since this is the only
tmux sesssion I am running on the VM host a simple 'tmux a' allows
me to attach.  Does this help?

tmux new-session -d -s vm
for vm in $my_vms; do
        tmux new-window -t vm \
                "doas -u vm${vm} /vm/${vm}/start-${vm}.sh"
done

Reply via email to