i2cssh 1.3.1 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +11 -9
- data/VERSION +1 -1
- data/bin/i2cssh +10 -1
- data/i2cssh.gemspec +1 -1
- data/lib/i2cssh.rb +11 -3
- metadata +3 -3
data/README.markdown
CHANGED
@@ -10,15 +10,17 @@ to all sessions.
|
|
10
10
|
|
11
11
|
## Usage
|
12
12
|
Usage: i2cssh [options]
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
13
|
+
-A, --forward-agent Enable SSH agent forwarding
|
14
|
+
-l, --login LOGIN SSH login name
|
15
|
+
-F, --fullscreen Make the window fullscreen
|
16
|
+
-C, --columns COLUMNS Number of columns (rows will be calculated)
|
17
|
+
-R, --rows ROWS Number of rows (columns will be calculated)
|
18
|
+
-b, --broadcast Start with broadcast input (DANGEROUS!)
|
19
|
+
-p, --profile PROFILE Name of the iTerm2 profile (default: Default)
|
20
|
+
-2, --iterm2 Use iTerm2 instead of iTerm
|
21
|
+
-f, --file FILE Cluster file (one hostname per line)
|
22
|
+
-c, --cluster CLUSTERNAME Name of the cluster specified in ~/.i2csshrc
|
23
|
+
-m, --machines a,b,c Comma-separated list of hosts
|
22
24
|
|
23
25
|
The cluster file format is one host per line.
|
24
26
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.3.
|
1
|
+
1.3.2
|
data/bin/i2cssh
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/ruby
|
2
2
|
require 'rubygems'
|
3
3
|
require 'optparse'
|
4
|
-
require 'i2cssh'
|
4
|
+
require 'lib/i2cssh'
|
5
5
|
|
6
6
|
i2_options, ssh_options, servers = {}, [], []
|
7
7
|
|
@@ -41,6 +41,15 @@ optparse = OptionParser.new do |opts|
|
|
41
41
|
'Start with broadcast input (DANGEROUS!)' do
|
42
42
|
i2_options[:broadcast] = true
|
43
43
|
end
|
44
|
+
opts.on '-p', '--profile PROFILE',
|
45
|
+
'Name of the iTerm2 profile (default: Default)' do |p|
|
46
|
+
i2_options[:profile] = p
|
47
|
+
puts p
|
48
|
+
end
|
49
|
+
opts.on "-2", '--iterm2',
|
50
|
+
'Use iTerm2 instead of iTerm' do
|
51
|
+
i2_options[:iterm2] = true
|
52
|
+
end
|
44
53
|
|
45
54
|
# Hosts
|
46
55
|
opts.on '-f', '--file FILE',
|
data/i2cssh.gemspec
CHANGED
data/lib/i2cssh.rb
CHANGED
@@ -7,11 +7,16 @@ class I2Cssh
|
|
7
7
|
@i2_options = i2_options
|
8
8
|
@servers = servers
|
9
9
|
|
10
|
+
app_name = (i2_options[:iterm2]) ? 'iTerm2' : 'iTerm'
|
11
|
+
|
10
12
|
raise Exception.new 'No servers given' if servers.empty?
|
11
13
|
|
12
14
|
@sys_events = Appscript.app.by_name('System Events')
|
13
|
-
@iterm = Appscript.app.by_name(
|
15
|
+
@iterm = Appscript.app.by_name(app_name)
|
14
16
|
@term = @iterm.make(:new => :terminal)
|
17
|
+
|
18
|
+
@profile = i2_options[:profile] || "Default"
|
19
|
+
|
15
20
|
session = @term.sessions.after.make :new => :session
|
16
21
|
session.exec :command => "/bin/bash -l"
|
17
22
|
|
@@ -70,10 +75,13 @@ class I2Cssh
|
|
70
75
|
1.upto(@rows*@columns) do |i|
|
71
76
|
server = @servers[i-1]
|
72
77
|
if server then
|
73
|
-
@term.sessions[i].write :text => "unset HISTFILE && #{@ssh_prefix} #{server}"
|
78
|
+
@term.sessions[i].write :text => "unset HISTFILE && echo -e \"\\033]50;SetProfile=#{@profile}\\a\" && #{@ssh_prefix} #{server}"
|
74
79
|
else
|
80
|
+
|
81
|
+
@term.sessions[i].write :text => "unset HISTFILE && echo -e \"\\033]50;SetProfile=#{@profile}\\a\""
|
82
|
+
sleep 0.2
|
75
83
|
@term.sessions[i].foreground_color.set "red"
|
76
|
-
@term.sessions[i].write :text => "
|
84
|
+
@term.sessions[i].write :text => "stty -isig -icanon -echo && echo -e '#{"\n"*100}UNUSED' && cat > /dev/null"
|
77
85
|
end
|
78
86
|
end
|
79
87
|
end
|
metadata
CHANGED