Class: HighLine::Terminal::IOConsole
- Inherits:
-
HighLine::Terminal
- Object
- HighLine::Terminal
- HighLine::Terminal::IOConsole
- Defined in:
- lib/highline/terminal/io_console.rb
Overview
io/console option for HighLine::Terminal. It's the most used terminal.
Instance Attribute Summary
Attributes inherited from HighLine::Terminal
Instance Method Summary collapse
-
#get_character ⇒ String
Get one character from the terminal.
-
#raw_no_echo_mode ⇒ Object
Enter Raw No Echo mode.
-
#restore_mode ⇒ Object
Restore terminal to its default mode.
-
#terminal_size ⇒ Array<Integer, Integer>
Two value terminal size like [columns, lines].
Methods inherited from HighLine::Terminal
#character_mode, #get_line, #get_line_default, #get_line_with_readline, get_terminal, #initialize, #initialize_system_extensions, #jruby?, #raw_no_echo_mode_exec, #readline_read, #rubinius?, #windows?
Constructor Details
This class inherits a constructor from HighLine::Terminal
Instance Method Details
#get_character ⇒ String
Get one character from the terminal
24 25 26 |
# File 'lib/highline/terminal/io_console.rb', line 24 def get_character # rubocop:disable Naming/AccessorMethodName input.getch # from ruby io/console end |
#raw_no_echo_mode ⇒ Object
Enter Raw No Echo mode.
14 15 16 |
# File 'lib/highline/terminal/io_console.rb', line 14 def raw_no_echo_mode input.echo = false end |
#restore_mode ⇒ Object
Restore terminal to its default mode
19 20 21 |
# File 'lib/highline/terminal/io_console.rb', line 19 def restore_mode input.echo = true end |
#terminal_size ⇒ Array<Integer, Integer>
Returns two value terminal size like [columns, lines].
9 10 11 |
# File 'lib/highline/terminal/io_console.rb', line 9 def terminal_size output.winsize.reverse end |