diff --git a/README.mkd b/README.mkd index 8301bdc..db67ccb 100644 --- a/README.mkd +++ b/README.mkd @@ -33,6 +33,7 @@ Teamocil is a tool used to automatically create sessions, windows and splits in width: 50 - cmd: memcached -p 11211 -vv height: 25 + target: bottom-right Running `$ teamocil sample` will rename the session to `sample-session` and create a new window named `sample-window` with a layout like this: diff --git a/lib/teamocil/layout.rb b/lib/teamocil/layout.rb index 0e3d2de..67f1e0c 100644 --- a/lib/teamocil/layout.rb +++ b/lib/teamocil/layout.rb @@ -34,14 +34,14 @@ module Teamocil window["splits"].each_with_index do |split, index| unless index == 0 if split.include?("width") - output << "tmux split-window -h -p #{split["width"]}" + cmd = "tmux split-window -h -p #{split["width"]}" + elsif split.include?("height") + cmd = "tmux split-window -p #{split["height"]}" else - if split.include?("height") - output << "tmux split-window -p #{split["height"]}" - else - output << "tmux split-window" - end + cmd = "tmux split-window" end + cmd << " -t #{split["target"]}" if split.include?("target") + output << cmd end # Support single command splits, but treat it as an array nevertheless