class Tmuxinator::Pane

Attributes

commands[R]
index[R]
project[R]
tab[R]

Public Class Methods

new(index, project, tab, *commands) click to toggle source
# File lib/tmuxinator/pane.rb, line 5
def initialize(index, project, tab, *commands)
  @commands = commands
  @index = index
  @project = project
  @tab = tab
end

Public Instance Methods

last?() click to toggle source
# File lib/tmuxinator/pane.rb, line 37
def last?
  index == tab.panes.length - 1
end
multiple_commands?() click to toggle source
# File lib/tmuxinator/pane.rb, line 41
def multiple_commands?
  commands && commands.length > 0
end
tmux_main_command(command) click to toggle source
# File lib/tmuxinator/pane.rb, line 28
def tmux_main_command(command)
  command ? "#{project.tmux} send-keys -t #{project.name}:#{tab.index + project.base_index}.#{index + tab.project.base_index} #{command.shellescape} C-m" : ""
end
tmux_pre_command() click to toggle source
# File lib/tmuxinator/pane.rb, line 16
def tmux_pre_command
  return unless tab.pre

  "#{project.tmux} send-keys -t #{tmux_window_and_pane_target} #{tab.pre.shellescape} C-m"
end
tmux_pre_window_command() click to toggle source
# File lib/tmuxinator/pane.rb, line 22
def tmux_pre_window_command
  return unless project.pre_window

  "#{project.tmux} send-keys -t #{tmux_window_and_pane_target} #{project.pre_window.shellescape} C-m"
end
tmux_split_command() click to toggle source
# File lib/tmuxinator/pane.rb, line 32
def tmux_split_command
  path = tab.root? ? "#{Tmuxinator::Config.default_path_option} #{tab.root}" : nil
  "#{project.tmux} splitw #{path} -t #{tab.tmux_window_target}"
end
tmux_window_and_pane_target() click to toggle source
# File lib/tmuxinator/pane.rb, line 12
def tmux_window_and_pane_target
  "#{project.name}:#{tab.index + project.base_index}.#{index + project.base_index}"
end