Class: HighLine::Terminal::NCurses
- Inherits:
-
HighLine::Terminal
- Object
- HighLine::Terminal
- HighLine::Terminal::NCurses
- Defined in:
- lib/highline/terminal/ncurses.rb
Overview
Note:
Code migrated UNTESTED
from the old code base to the new
NCurses HighLine::Terminal terminal api.
Instance Attribute Summary
Attributes inherited from HighLine::Terminal
Instance Method Summary collapse
-
#raw_no_echo_mode ⇒ Object
Enter Raw No Echo mode.
-
#restore_mode ⇒ Object
Restore terminal to its default mode.
-
#terminal_size ⇒ Array<Integer, Integer>
A ncurses savvy method to fetch the console columns, and rows.
Methods inherited from HighLine::Terminal
#character_mode, #get_character, #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
#raw_no_echo_mode ⇒ Object
Enter Raw No Echo mode.
12 13 14 15 |
# File 'lib/highline/terminal/ncurses.rb', line 12 def raw_no_echo_mode FFI::NCurses.initscr FFI::NCurses.cbreak end |
#restore_mode ⇒ Object
Restore terminal to its default mode
18 19 20 |
# File 'lib/highline/terminal/ncurses.rb', line 18 def restore_mode FFI::NCurses.endwin end |
#terminal_size ⇒ Array<Integer, Integer>
A ncurses savvy method to fetch the console columns, and rows.
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/highline/terminal/ncurses.rb', line 26 def terminal_size size = [80, 40] FFI::NCurses.initscr begin size = FFI::NCurses.getmaxyx(FFI::NCurses.stdscr).reverse ensure FFI::NCurses.endwin end size end |