multiple panes with tmuxinator

1.2k Views Asked by At

I' trying to build a tmuxinator with multiple windows and in one of them i`d like to build 2 panes:

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

it doesnt run any of my last window commands, here its debug:

 # 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
2

There are 2 best solutions below

1
On

It seems there are some points to fix.

  1. pre_window: should be top-level, not under windows:.
  2. Any hash element (like name:) is not allowed under the pane:.

Like this.

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
0
On

The way you wrote the commands for the panes in that particular window is wrong. It should have been something like this:

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

This creates 2 horizontal splits first then splits the first one vertically.

To use horizontal or vertical splits throughout the window, use main-horizontal or main-vertical.

Like this:

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