Class: Tmux::StatusBar

Inherits:
Object
  • Object
show all
Defined in:
lib/tmux/status_bar.rb,
lib/tmux/status_bar/field.rb

Overview

Every session has a status bar. This is where various information as well as a list of windows will be displayed. For this purpose, the status bar is divided into three parts: the left, center and right part. While the center part displays the window list, the left and right part can be set to display any text.

This class allows accessing various attributes (e.g. the background color of the bar) and the editable parts (left and right).

Note: You will not have to instantiate this class. Use Tmux::Session#status_bar instead.

Defined Under Namespace

Classes: Field

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(session) ⇒ StatusBar

Returns a new instance of StatusBar.

Parameters:



32
33
34
35
36
# File 'lib/tmux/status_bar.rb', line 32

def initialize(session)
  @session = session
  @left    = Field.new(self,  :left)
  @right   = Field.new(self, :right)
end

Instance Attribute Details

#background_colorSymbol

Returns:

  • (Symbol)


53
54
55
# File 'lib/tmux/status_bar.rb', line 53

def background_color
  @background_color
end

#foreground_colorSymbol

Returns:

  • (Symbol)


65
66
67
# File 'lib/tmux/status_bar.rb', line 65

def foreground_color
  @foreground_color
end

#intervalNumber

Returns The interval in which the status bar will be updated.

Returns:

  • (Number)

    The interval in which the status bar will be updated.



78
79
80
# File 'lib/tmux/status_bar.rb', line 78

def interval
  @interval
end

#justificationSymbol<:left, :right, :centre>

Sets the justification of the window list component of the status line.

Returns:

  • (Symbol<:left, :right, :centre>)


93
94
95
# File 'lib/tmux/status_bar.rb', line 93

def justification
  @justification
end

#keymapSymbol<:emacs, :vi>

Returns:

  • (Symbol<:emacs, :vi>)


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

def keymap
  @keymap
end

#leftField (readonly)

The left field which may display custom text and widgets.

Returns:



24
25
26
# File 'lib/tmux/status_bar.rb', line 24

def left
  @left
end

#rightField (readonly)

The right field which may display custom text and widgets.

Returns:



30
31
32
# File 'lib/tmux/status_bar.rb', line 30

def right
  @right
end

#sessionSession (readonly)

Returns:



19
20
21
# File 'lib/tmux/status_bar.rb', line 19

def session
  @session
end

#utf8Boolean Also known as: utf8?

Instruct tmux to treat top-bit-set characters in Tmux::StatusBar::Field#text as UTF-8. Notably, this is important for wide characters. This option defaults to false.

Returns:

  • (Boolean)


122
123
124
# File 'lib/tmux/status_bar.rb', line 122

def utf8
  @utf8
end

Instance Method Details

#hide

This method returns an undefined value.

Hides the status bar.



41
42
43
# File 'lib/tmux/status_bar.rb', line 41

def hide
  @session.options.status = false
end

#show

This method returns an undefined value.

Shows the status bar.



48
49
50
# File 'lib/tmux/status_bar.rb', line 48

def show
  @session.options.status = true
end