Class: Appear::Tmux::Pane

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

Overview

A tmux pane.

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 this pane the active pane in this session.

Returns:

  • (Boolean)

    is this pane the active pane in this session



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

property :active?, var: :active, tmux: :pane_active, parse: proc {|a| a.to_i != 0 }

#command_nameString

Returns command running in this pane.

Returns:

  • (String)

    command running in this pane



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

property :command_name, tmux: :pane_current_command

#current_pathString

Returns pane current path.

Returns:

  • (String)

    pane current path



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

property :current_path, tmux: :pane_current_path

#idString

Returns window id.

Returns:

  • (String)

    window id



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

property :id, :tmux => :pane_id

#paneFixnum

Returns pane index.

Returns:

  • (Fixnum)

    pane index



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

property :pane, tmux: :pane_index, parse: :to_i

#pidFixnum

Returns pid of the process running in the pane.

Returns:

  • (Fixnum)

    pid of the process running in the pane



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

property :pid, tmux: :pane_pid, parse: :to_i

#revealObject

Reveal this pane



110
111
112
# File 'lib/appear/tmux.rb', line 110

def reveal
  tmux.reveal_pane(self)
end

#send_keys(keys, opts = {}) ⇒ Object

Send keys to this pane

Parameters:

  • keys (String)
  • opts (Hash) (defaults to: {})


118
119
120
# File 'lib/appear/tmux.rb', line 118

def send_keys(keys, opts = {})
  tmux.send_keys(self, keys, opts)
end

#sessionString

Returns session name.

Returns:

  • (String)

    session name



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

property :session, tmux: :session_name

#split(opts = {}) ⇒ Object

Split this pane

Parameters:

  • opts (Hash) (defaults to: {})


105
106
107
# File 'lib/appear/tmux.rb', line 105

def split(opts = {})
  tmux.split_window(opts.merge(:t => target))
end

#targetString

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

Returns:

  • (String)


97
98
99
100
# File 'lib/appear/tmux.rb', line 97

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

#windowFixnum

Returns window index.

Returns:

  • (Fixnum)

    window index



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

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