Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tmuxinator initialize pane with multiple commands

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
like image 685
amdorra Avatar asked Dec 22 '13 09:12

amdorra


3 Answers

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

like image 121
Soliah Avatar answered Sep 27 '22 15:09

Soliah


you could put && between commands.

panes:
    - vim
    - workon project &&           #activate virtualenv and ..
      ./manage.py runserver       #run sever
like image 27
amdorra Avatar answered Sep 27 '22 16:09

amdorra


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.

like image 33
anhdat Avatar answered Sep 27 '22 15:09

anhdat