Added target param to splits

target maps to -t on split-window
This commit is contained in:
Jimmy Bourassa 2011-09-25 00:04:16 -04:00
parent ae34459d7c
commit 7369a81413
2 changed files with 7 additions and 6 deletions

View File

@ -33,6 +33,7 @@ Teamocil is a tool used to automatically create sessions, windows and splits in
width: 50 width: 50
- cmd: memcached -p 11211 -vv - cmd: memcached -p 11211 -vv
height: 25 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: Running `$ teamocil sample` will rename the session to `sample-session` and create a new window named `sample-window` with a layout like this:

View File

@ -34,14 +34,14 @@ module Teamocil
window["splits"].each_with_index do |split, index| window["splits"].each_with_index do |split, index|
unless index == 0 unless index == 0
if split.include?("width") 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 else
if split.include?("height") cmd = "tmux split-window"
output << "tmux split-window -p #{split["height"]}"
else
output << "tmux split-window"
end
end end
cmd << " -t #{split["target"]}" if split.include?("target")
output << cmd
end end
# Support single command splits, but treat it as an array nevertheless # Support single command splits, but treat it as an array nevertheless