Sha256: fe48a84f8ed40634d2b5bb4836228a5540f8f832c30cd061a0a0f4836140dc63

Contents?: true

Size: 1.29 KB

Versions: 1

Compression:

Stored size: 1.29 KB

Contents

#!<%= ENV["SHELL"] || "/bin/bash" %>
<%= tmux %> start-server\; has-session -t <%= name %> 2>/dev/null

if [ "$?" -eq 1 ]; then
  cd <%= root || "." %>

  # Run pre command.
  <%= pre %>

  # Create the session and the first window.
  TMUX= <%= tmux %> new-session -d -s <%= name %> -n <%= windows.first.name %>

  # Set the default path.
  <%= tmux %> set-option -t <%= name %> default-path <%= root.shellescape -%> 1>/dev/null

  # Create other windows.
  <%- windows.drop(1).each do |window| -%>
  <%= window.tmux_new_window_command %>
  <%- end -%>

  <%- windows.each do |window| -%>

  # Window "<%= window.name %>"
    <%- unless window.panes? -%>
  <%= window.tmux_pre_window_command %>
    <%- window.commands.each do |command| -%>
  <%= command %>
    <%- end -%>
    <%- else -%>
      <%- window.panes.each do |pane| -%>
  <%= pane.tmux_pre_window_command %>
  <%= pane.tmux_pre_command %>
  <%= pane.tmux_main_command %>

      <%- unless pane.last? -%>
  <%= pane.tmux_split_command %>
      <%- end -%>
  <%= window.tmux_layout_command %>
    <%- end -%>

  <%= window.tmux_select_first_pane %>
    <%- end -%>
  <%- end -%>

  <%= tmux %> select-window -t <%= base_index %>
fi

if [ -z "$TMUX" ]; then
  <%= tmux %> -u attach-session -t <%= name %>
else
  <%= tmux %> -u switch-client -t <%= name %>
fi

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tmuxinator-0.6.6.pre lib/tmuxinator/assets/template.erb