Parent

Teamocil::Layout::Session

This class represents a session within tmux

Attributes

name[R]
options[R]
windows[R]

Public Class Methods

new(options, attrs={}) click to toggle source

Initialize a new tmux session

@param options [Hash] the options, mostly passed by the CLI @param attrs [Hash] the session data from the layout file

# File lib/teamocil/layout/session.rb, line 12
def initialize(options, attrs={}) # {{{
  @name = attrs["name"]
  @windows = attrs["windows"].each_with_index.map { |window, window_index| Window.new(self, window_index, window) }
  @options = options
end

Public Instance Methods

generate_commands() click to toggle source

Generate commands to send to tmux

@return [Array]

# File lib/teamocil/layout/session.rb, line 21
def generate_commands # {{{
  commands = []
  commands << "tmux rename-session \"#{@name}\"" unless @name.nil?
  commands << @windows.map(&:generate_commands)
  commands << "tmux select-pane -t 0"
  commands
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.