tmuxinator initialize pane with multiple commands

荒凉一梦 提交于 2019-12-12 08:27:16

问题


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

回答1:


This is supported from 0.6.6.

name: sample
root: ~/

windows:
  - stats:
    - ssh stats@example.com
    - tail -f /var/log/stats.log
  - logs:
    layout: main-vertical
    panes:
      - logs:
        - ssh logs@example.com
        - cd /var/logs
        - tail -f development.log

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




回答2:


you could put && between commands.

panes:
    - vim
    - workon project &&           #activate virtualenv and ..
      ./manage.py runserver       #run sever



回答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.



来源:https://stackoverflow.com/questions/20728102/tmuxinator-initialize-pane-with-multiple-commands

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!