Class: Terminal::Window

Inherits:
Object
  • Object
show all
Defined in:
lib/terminal-multiplexer/window.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = 'tab', command = 'zsh') ⇒ Window

Create a tmux window



9
10
11
12
13
14
15
16
17
# File 'lib/terminal-multiplexer/window.rb', line 9

def initialize(name = 'tab', command = 'zsh')

  name = 'tab' if name == nil  or name == ''
  command = 'zsh' if command == nil  or command == ''

  @name = name
  @command = command
  @options = []
end

Instance Attribute Details

#commandObject

Returns the value of attribute command.



3
4
5
# File 'lib/terminal-multiplexer/window.rb', line 3

def command
  @command
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/terminal-multiplexer/window.rb', line 3

def name
  @name
end

Instance Method Details

#plainObject

Return the tmux string for the window



21
22
23
24
# File 'lib/terminal-multiplexer/window.rb', line 21

def plain
  @options.push "-n #{name}"
  "new-window #{@options.join(' ')} #{command}\\;"
end