Class: Appear::Terminal::Iterm2
- Inherits:
-
MacTerminal
- Object
- BaseService
- Service
- MacTerminal
- Appear::Terminal::Iterm2
- Defined in:
- lib/appear/terminal.rb
Overview
Iterm2 support service.
Instance Method Summary collapse
- #app_name ⇒ Object
-
#new_window(command_str) ⇒ #tty
Create a new window running the given command.
- #panes ⇒ Object
- #reveal_pane(pane) ⇒ Object
Methods inherited from MacTerminal
Methods inherited from BaseService
delegate, #initialize, require_service, required_services
Constructor Details
This class inherits a constructor from Appear::BaseService
Instance Method Details
#app_name ⇒ Object
99 100 101 |
# File 'lib/appear/terminal.rb', line 99 def app_name 'iTerm2' end |
#new_window(command_str) ⇒ #tty
Create a new window running the given command.
121 122 123 124 |
# File 'lib/appear/terminal.rb', line 121 def new_window(command_str) res = services.mac_os.call_method('iterm2_new_window', command_str) OpenStruct.new(res) end |
#panes ⇒ Object
104 105 106 107 108 109 110 |
# File 'lib/appear/terminal.rb', line 104 def panes pids = services.processes.pgrep(app_name) services.mac_os.call_method('iterm2_panes').map do |hash| hash[:pids] = pids OpenStruct.new(hash) end end |
#reveal_pane(pane) ⇒ Object
113 114 115 |
# File 'lib/appear/terminal.rb', line 113 def reveal_pane(pane) services.mac_os.call_method('iterm2_reveal_tty', pane.tty) end |