def generate_commands
commands = []
init_command = ""
unless @index == 0
if !@width.nil?
init_command = "tmux split-window -h -p #{@width}"
elsif !@height.nil?
init_command = "tmux split-window -p #{@height}"
else
init_command = "tmux split-window"
end
init_command << " -t #{@target}" unless @target.nil?
commands << init_command
end
@cmd = [@window.filters["before"]] + [@cmd] + [@window.filters["after"]]
@cmd.unshift "cd \"#{@window.root}\"" unless @window.root.nil?
@cmd.unshift "export TEAMOCIL=1"
@cmd.flatten.compact.each do |command|
commands << "tmux send-keys -t #{@index} \"#{command}\""
commands << "tmux send-keys -t #{@index} Enter"
end
commands
end