Class: Godo::ITermSession

Inherits:
Session
  • Object
show all
Defined in:
lib/sessions/iterm_session.rb

Instance Attribute Summary

Attributes inherited from Session

#path

Instance Method Summary collapse

Methods inherited from Session

#counter, #create, #set_label

Constructor Details

#initialize(path) ⇒ ITermSession

Returns a new instance of ITermSession.



8
9
10
11
# File 'lib/sessions/iterm_session.rb', line 8

def initialize( path )
  super( path )
  @@iterm ||= Appscript::app( 'iTerm' )
end

Instance Method Details

#execute(command) ⇒ Object



18
19
20
# File 'lib/sessions/iterm_session.rb', line 18

def execute( command )
  @session.write( :text => command )
end

#startObject



13
14
15
16
# File 'lib/sessions/iterm_session.rb', line 13

def start
  @session = @@iterm.current_terminal.sessions.end.make( :new => :session )
  @session.exec( :command => 'bash -l' )
end