Class: Appear::Tmux::Window

Inherits:
TmuxValue show all
Defined in:
lib/appear/tmux.rb

Overview

A tmux window. Has many panes.

Instance Method Summary collapse

Methods inherited from TmuxValue

format_string, parse, property, #tmux

Methods inherited from Util::ValueClass

#initialize, properties, property

Constructor Details

This class inherits a constructor from Appear::Util::ValueClass

Instance Method Details

#active?Boolean

Returns is the window active?.

Returns:

  • (Boolean)

    is the window active?



182
183
184
185
# File 'lib/appear/tmux.rb', line 182

property :active?,
:tmux => :window_active,
:var => :active,
:parse => proc {|b| b.to_i != 0}

#idString

Returns window id.

Returns:

  • (String)

    window id



179
# File 'lib/appear/tmux.rb', line 179

property :id, :tmux => :window_id

#panesArray<Pane>

Returns:



188
189
190
# File 'lib/appear/tmux.rb', line 188

def panes
  tmux.panes.select { |p| p.session == session && p.window == window }
end

#sessionString

Returns session name.

Returns:

  • (String)

    session name



173
# File 'lib/appear/tmux.rb', line 173

property :session, :tmux => :session_name

#targetString

String suitable for use as the “target” specifier for a Tmux command

Returns:

  • (String)


195
196
197
198
# File 'lib/appear/tmux.rb', line 195

def target
  # "#{session}:#{window}"
  id
end

#windowFixnum

Returns window index.

Returns:

  • (Fixnum)

    window index



176
# File 'lib/appear/tmux.rb', line 176

property :window, :tmux => :window_index, :parse => :to_i