Module: Lab42::Tmux::CurrentWindow

Included in:
Command
Defined in:
lib/lab42/tmux/current_window.rb

Instance Method Summary collapse

Instance Method Details

#tmux_current_windowObject



5
6
7
# File 'lib/lab42/tmux/current_window.rb', line 5

def tmux_current_window
  "-t #{tmux_current_window_designation}"
end

#tmux_current_window_command(cmd, *args) ⇒ Object



9
10
11
12
13
# File 'lib/lab42/tmux/current_window.rb', line 9

def tmux_current_window_command cmd, *args
  args = args.compact
  arguments = args.empty? ? "" : " #{args.join(" ")}"
  tmux "#{cmd} #{tmux_current_window}#{arguments}"
end

#tmux_current_window_designationObject



15
16
17
# File 'lib/lab42/tmux/current_window.rb', line 15

def tmux_current_window_designation
  [session_name, tmux_current_window_number].join(":")
end

#tmux_current_window_numberObject



18
19
20
# File 'lib/lab42/tmux/current_window.rb', line 18

def tmux_current_window_number
  @__tmux_current_window_number__ ||= 0
end

#tmux_current_window_number=(new_val) ⇒ Object



22
23
24
# File 'lib/lab42/tmux/current_window.rb', line 22

def tmux_current_window_number= new_val
  @__tmux_current_window_number__ = new_val
end