【问题标题】:multiple panes with tmuxinator带有 tmuxinator 的多个窗格
【发布时间】:2017-05-22 23:23:33
【问题描述】:

我正在尝试构建一个具有多个窗口的 tmuxinator,我想在其中一个窗口中构建 2 个窗格:

name: bigbang-server
root: ~/projects/bigbang

windows:
  - CORE:
    - ...
  - CONSOLE:
    - ...
  - FUND_TRANSACTIONS:
    - ...
  - CLIENT_POSITIONS:
    pre_window: cd ~/projects/bigbang_services/
    panes:
      server:
        - env PORT=3002 rails server
      sidekiq:
        - bundle exec sidekiq -C config/sidekiq.yml

它没有运行我最后的任何窗口命令,这里是它的调试:

 # Window "CLIENT_POSITIONS"


  tmux select-window -t 1
  tmux select-pane -t 0

  if [ -z "$TMUX" ]; then
    tmux -u attach-session -t bigbang-server
  else
    tmux -u switch-client -t bigbang-server
  fi

【问题讨论】:

    标签: tmux tmuxinator


    【解决方案1】:

    似乎有一些地方需要解决。

    1. pre_window: 应该是顶级的,而不是在windows: 之下。
    2. pane: 下不允许使用任何哈希元素(如 name:)。

    像这样。

    name: bigbang-server
    root: ~/projects/bigbang
    pre_window: cd ~/projects/bigbang_services/
    windows:
      - CORE:
        - ...
      - CONSOLE:
        - ...
      - FUND_TRANSACTIONS:
        - ...
      - CLIENT_POSITIONS:
          panes:
            - env PORT=3002 rails server
            - bundle exec sidekiq -C config/sidekiq.yml
    

    【讨论】:

    • 但我想将不同的窗格放在不同的目录中
    【解决方案2】:

    您为该特定窗口中的窗格编写命令的方式是错误的。 应该是这样的:

    windows:
        - CLIENT_POSTIONS:
            panes:
                - cd ~/projects/bigbang_services/
                - env PORT=3002 rails server
                - bundle exec sidekiq -C config/sidekiq.yml
    

    这会首先创建 2 个水平分割然后垂直分割第一个。

    要在整个窗口中使用水平或垂直分割, 使用main-horizontalmain-vertical

    像这样:

    windows:
        - CLIENT_POSTIONS:
            layout: main-vertical # or main-horizontal
            panes:
                - cd ~/projects/bigbang_services/
                - env PORT=3002 rails server
                - bundle exec sidekiq -C config/sidekiq.yml
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多