tmuxinatorでcan't find pane: 1 #tmux

原因と対策をメモします。

バージョン

$ tmux -V
tmux 1.8

$ gem list | grep tmuxinator
tmuxinator (0.6.7) 

現象

以下のような設定でtmuxを起動すると、"can't find pane: 1"エラーが発生してしまい、pane内で実行されるはずのecho1,echo2のコマンドが実行されません。

  • window内にpaneを設定
  • pane内でコマンドを実行
$ cat ~/.tmuxinator/test.yml
# ~/.tmuxinator/test.yml

name: test
root: ~/

windows:
  - editor:
      layout: main-vertical
      panes:
        - echo 1
        - echo 2

$ mux test
can't find pane: 1
can't find pane: 1
arranging in: main-vertical
can't find pane: 2
can't find pane: 2
arranging in: main-vertical
[exited]

原因

.tmux.confに設定している「set-option -g base-index 1」が悪さをしていることが解りました。 tmuxinatorのpaneに対する設定はpaneインデックスの0から実行されるため、オプションでベースインデックス番号を変更している場合、問題のエラーが発生することがわかりました。

対策

「set-option -g base-index 0」を設定することで解決しました。

参考

https://github.com/tmuxinator/tmuxinator/pull/155