    # File lib/chef/knife/ssh.rb, line 258
          def tmux
            ssh_dest = lambda do |server|
              identity = "-i #{config[:identity_file]} " if config[:identity_file]
              prefix = server.user ? "#{server.user}@" : ""
              "'ssh #{identity}#{prefix}#{server.host}'"
            end

            new_window_cmds = lambda do
              if session.servers_for.size > 1
                [""] + session.servers_for[1..-1].map do |server|
                  "new-window -a -n '#{server.host}' #{ssh_dest.call(server)}"
                end
              else
                []
              end.join(" \\; ")
            end

            tmux_name = "'knife ssh #{@name_args[0].gsub(/:/,'=')}'"
            begin
              server = session.servers_for.first
              cmd = ["tmux new-session -d -s #{tmux_name}",
                     "-n '#{server.host}'", ssh_dest.call(server),
                     new_window_cmds.call].join(" ")
              Chef::Mixin::Command.run_command(:command => cmd)
              exec("tmux attach-session -t #{tmux_name}")
            rescue Chef::Exceptions::Exec
            end
          end