i2cssh 1.3.1 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,15 +10,17 @@ to all sessions.
10
10
 
11
11
  ## Usage
12
12
  Usage: i2cssh [options]
13
- -d, --debug Start RIPL after creating terminals
14
- -A, --forward-agent Enable SSH agent forwarding
15
- -f, --file FILE Cluster file (one hostname per line)
16
- -F, --fullscreen Fullscreen
17
- -l, --login LOGIN SSH login name
18
- -c, --cluster CLUSTERNAME Name of the cluster specified in ~/.i2csshrc
19
- -m, --machines a,b,c Comma-separated list of hosts
20
- -C, --columns COLUMNS Amount of columns (rows will be calculated)
21
- -R, --rows ROWS Amount of rows (columns will be calculated)
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
+ 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',
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "i2cssh"
8
- s.version = "1.3.1"
8
+ s.version = "1.3.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Wouter de Bie"]
@@ -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('iTerm')
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 => "unset HISTFILE && stty -isig -icanon -echo && echo -e '#{"\n"*100}UNUSED' && cat > /dev/null"
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
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i2cssh
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 3
9
- - 1
10
- version: 1.3.1
9
+ - 2
10
+ version: 1.3.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Wouter de Bie