bash - How to launch tmux with pre-opened second window and execute commands? -
there's possible duplicate it's closed , unanswered.
as i'm using chef automation, nice automate tmux launch pre-launched python web server , second window opened. (this development environment). , way of doing specifying parameters command line.
commands want execute in window title "daemon":
source bin/activate cd project debug=1 python app.py
i'm unable find command line parameters allows pre-execute commands when launching tmux, , open more windows on launch.
you want create session without attaching (using -d
option), can send additional tmux
commands open second window before attaching.
tmux new-session -t mysession -d 'source bin/activate; cd project; debug=1 python app.py' tmux new-window -t mysession tmux attach-session -t mysession
Comments
Post a Comment