Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am using tmuxinator. Here is my project file.

project_name: Network
project_root: ~/Code/Network
tabs:
  - editor: vim
  - worker: 
      layout: cd49,181x48,0,0[181x5,0,0{90x5,0,0,90x5,91,0},181x42,0,6]
      panes:
        - QUEUE=high,normal,low rake resque:work
        - 
        - 
  - console: rails c

Below is a worker tab

enter image description here

Is there a way to disable only for this tab closing panes? I would like to prevent this:

enter image description here

share|improve this question

1 Answer 1

up vote 0 down vote accepted

You probably want to set the window option remain-on-exit to true for that window. I do not use tmuxinator, so I do not know whether/how this can be cleanly configured in that context. Here is how you would use a plain tmux command to set it for an existing window named worker:

tmux set-option -w -t :worker remain-on-exit on

This is a window option, so it will apply to all the panes in that window. After a pane’s command has exited, you can use respawn-pane to start its command anew.

tmux respawn-pane -t :worker.0

(Or Prefix:respawn-pane to respawn the current pane.)

This may not do what you expect, though, since tmuxinator seems to always create “default” panes/windows and then “type in” your configured command (i.e. the command restarted by respawn-pane will be a plain shell, not the command configured for the pane in your tmuxinator configuration). You may want to run your command in a loop instead (in your tmuxinator configuration):

while :; do QUEUE=high,normal,low rake resque:work; printf 'Hit enter to re-run... (C-c to abort)'; read; done
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.