Method: CommandKit::Terminal#terminal_height

Defined in:
lib/command_kit/terminal.rb

#terminal_heightInteger

Returns the terminal's height in number of lines.

Examples:

terminal_height
# => 22

Returns:

  • (Integer)

    The terminal's height in number of lines.



111
112
113
114
115
116
117
# File 'lib/command_kit/terminal.rb', line 111

def terminal_height
  if (terminal = self.terminal)
    terminal.winsize[0]
  else
    @terminal_height
  end
end