diff options
author | Sergey Permyakov <permyakovsv@gmail.com> | 2015-09-10 22:33:47 +0300 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2015-10-24 20:25:11 -0700 |
commit | 766a814831c93b14d815ee86a5ba7f21cfd6ff60 (patch) | |
tree | 50acdd48c13d33f50ce51af789e2bf42f3f79d0f /lib/chef/knife | |
parent | 6ae6710477ac618fafcfc46812984deae1b983b5 (diff) | |
download | chef-766a814831c93b14d815ee86a5ba7f21cfd6ff60.tar.gz |
Add option --tmux-split
Diffstat (limited to 'lib/chef/knife')
-rw-r--r-- | lib/chef/knife/ssh.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/chef/knife/ssh.rb b/lib/chef/knife/ssh.rb index 1d3822b82f..89a9608c60 100644 --- a/lib/chef/knife/ssh.rb +++ b/lib/chef/knife/ssh.rb @@ -111,6 +111,12 @@ class Chef :boolean => true, :proc => Proc.new { :raise } + option :tmux_split, + :long => "--tmux-split", + :description => "Split tmux window.", + :boolean => true, + :default => false + def session config[:on_error] ||= :skip ssh_error_handler = Proc.new do |server| @@ -394,7 +400,7 @@ class Chef exec("screen -c #{tf.path}") end - def tmux(split = false) + def tmux ssh_dest = lambda do |server| identity = "-i #{config[:identity_file]} " if config[:identity_file] prefix = server.user ? "#{server.user}@" : "" @@ -404,7 +410,7 @@ class Chef new_window_cmds = lambda do if session.servers_for.size > 1 [""] + session.servers_for[1..-1].map do |server| - if split + if config[:tmux_split] "split-window #{ssh_dest.call(server)}; tmux select-layout tiled" else "new-window -a -n '#{server.host}' #{ssh_dest.call(server)}" @@ -538,8 +544,6 @@ class Chef screen when "tmux" tmux - when "tmux-split" - tmux(true) when "macterm" macterm when "cssh" |