tmuxinator initialize pane with multiple commands
Asked Answered
M

3

15

I am using Tmuxinator, and I was wondering is there anyway to initialize a Tmux pane using multiple commands?

Example

panes:
    - vim
    - workon project              #activate virtualenv and ..
      ./manage.py runserver       #run sever
Malcolm answered 22/12, 2013 at 9:46 Comment(0)
R
29

This is supported from 0.6.6.

name: sample
root: ~/

windows:
  - stats:
    - ssh [email protected]
    - tail -f /var/log/stats.log
  - logs:
    layout: main-vertical
    panes:
      - logs:
        - ssh [email protected]
        - cd /var/logs
        - tail -f development.log

Please refer to https://github.com/aziz/tmuxinator#passing-directly-to-send-keys

Reiterate answered 4/1, 2014 at 14:29 Comment(0)
M
6

you could put && between commands.

panes:
    - vim
    - workon project &&           #activate virtualenv and ..
      ./manage.py runserver       #run sever
Malcolm answered 23/12, 2013 at 1:3 Comment(0)
C
3

For particular using with virtualenv and if you don't want to include workon project && in every line, you can use pre_window, available from 0.6.0:

pre_window: workon project

Now before running any command, a workon project would be called first, allow you to have every new window in virtual environment.

Carditis answered 29/10, 2015 at 16:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.