class Tmux::StatusBar

Every {Session session} has a status bar. This is where various information as well as a list of {Window 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 background color} of the bar) and the editable parts ({#left left} and {#right right}).

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

Attributes

background_color[RW]

@return [Symbol]

foreground_color[RW]

@return [Symbol]

interval[RW]

@return [Number] The interval in which the status bar will be

updated.
justification[RW]

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

@return [Symbol<:left, :right, :centre>]

keymap[RW]

@return [Symbol<:emacs, :vi>]

left[R]

The left {Field field} which may display custom {Field#text text} and {Widget widgets}.

@return [Field]

right[R]

The right {Field field} which may display custom {Field#text text} and {Widget widgets}.

@return [Field]

session[R]

@return [Session]

utf8[RW]

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

@return [Boolean]

utf8?[RW]

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

@return [Boolean]

Public Class Methods

new(session) click to toggle source

@param [Session] session

# File lib/tmux/status_bar.rb, line 32
def initialize(session)
  @session = session
  @left    = Field.new(self,  :left)
  @right   = Field.new(self, :right)
end

Public Instance Methods

background_color=(color) click to toggle source
# File lib/tmux/status_bar.rb, line 60
def background_color=(color)
  @session.options.status_bg = color
end
foreground_color=(color) click to toggle source
# File lib/tmux/status_bar.rb, line 72
def foreground_color=(color)
  @session.options.status_fg = color
end
hide() click to toggle source

Hides the status bar.

@return [void]

# File lib/tmux/status_bar.rb, line 41
def hide
  @session.options.status = false
end
interval=(value) click to toggle source
# File lib/tmux/status_bar.rb, line 85
def interval=(value)
  @session.options.status_interval = value
end
justification=(val) click to toggle source
# File lib/tmux/status_bar.rb, line 100
def justification=(val)
  @session.options.status_justify = val
end
keymap=(val) click to toggle source
# File lib/tmux/status_bar.rb, line 113
def keymap=(val)
  @session.options.status_keys = val
end
show() click to toggle source

Shows the status bar.

@return [void]

# File lib/tmux/status_bar.rb, line 48
def show
  @session.options.status = true
end
utf8=(bool) click to toggle source
# File lib/tmux/status_bar.rb, line 130
def utf8=(bool)
  @session.options.status_utf8 = bool
end