bin/i2cssh in i2cssh-0.0.6 vs bin/i2cssh in i2cssh-0.0.7
- old
+ new
@@ -14,10 +14,11 @@
opts.on('-F', '--fullscreen', "Fullscreen") { options[:fullscreen] = true }
opts.on('-u', '--username USERNAME', "SSH username") { |u| options[:username] = u }
opts.on('-c', '--cluster CLUSTERNAME', "Name of the cluster specified in ~/.i2csshrc") { |c| options[:cluster] = c }
opts.on('-C', '--columns COLUMNS', "Amount of columns (rows will be calculated)") { |c| options[:columns] = c }
opts.on('-R', '--rows ROWS', "Amount of rows (columns will be calculated)") { |r| options[:rows] = r }
+ opts.on('-s', '--session SESSIONNAME', "Name of an iTerm2 session") { |s| options[:session_name] = s }
end
optparse.parse!
unless options[:file] || options[:cluster] then
@@ -62,12 +63,12 @@
end
iterm = Appscript.app.by_name('iTerm')
finder = Appscript.app.by_name('Finder')
sys_events = Appscript.app.by_name('System Events')
-
term = iterm.make(:new => :terminal)
+
session = term.sessions.after.make(:new => :session)
session.exec(:command => "/bin/bash -l")
if options[:fullscreen] then
window_bounds = finder.desktop.window.bounds
@@ -88,13 +89,13 @@
end
end
(rows * columns).times do |i|
if servers && servers[i] then
- term.sessions[i+1].write(:text => "#{ssh_prefix}#{servers[i]}")
+ term.sessions[i+1].write(:text => "history -d $(($HISTCMD-1)) && #{ssh_prefix}#{servers[i]}")
else
term.sessions[i+1].foreground_color.set("red")
- term.sessions[i+1].write(:text => "echo -e '#{"\n"*100}UNUSED'")
+ term.sessions[i+1].write(:text => "history -d $(($HISTCMD-1)) && echo -e '#{"\n"*100}UNUSED'")
end
end
if options[:debug] then
require 'ripl'
Ripl.start :binding => binding