Hey Philip,

Take a look at e.g. the new-window and split-window commands in tmux(1). They 
have a positional argument that specifies a command to run.

Few examples:

new-window 'top'
split-window -v '/usr/local/bin/moon-buggy'
split-window -h -l86% '/usr/local/bin/mc'

You can use these commands providing them as parameters to tmux(1) from the 
command line when starting tmux(1), from your configuration file, and within 
tmux(1) directly after getting into command mode (CTRL+b :) by default.

Daniel


On Sunday, March 9th, 2025 at 07:10, Philip Guenther <guent...@gmail.com> 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
> 
> So, what do I need to put in a .tmux.conf to have tmux start up and
> create a set of windows? Ideally it would leave me in the first but
> that would be gravy.
> 
> I tried putting a bunch of "new-window" lines in and it helpfully
> reports the file+line# and "no current target". Ok, so I guess I need
> a session first, so I put
> new-session -A
> 
> before the new-window lines...and it creates a second session, puts
> my new-window's into that, but leaves my current invocation in a
> session with just the default window. How do I convince it to create
> my windows in the session that it already created?
> 
> I don't see any examples in the manpage of how to create windows at
> startup. Does anyone have guidance or an example of what to write to
> do this?
> 
> 
> Philip Guenther

Reply via email to