io/console option for HighLine::Terminal. It's the most used terminal. TODO: We're rescuing when not a terminal.
We should make a more robust implementation.
(see HighLine::Terminal#get_character)
# File lib/highline/terminal/io_console.rb, line 29 def get_character input.getch # from ruby io/console rescue Errno::ENOTTY input.getc end
(see HighLine::Terminal#raw_no_echo_mode)
# File lib/highline/terminal/io_console.rb, line 17 def raw_no_echo_mode input.echo = false rescue Errno::ENOTTY end
(see HighLine::Terminal#restore_mode)
# File lib/highline/terminal/io_console.rb, line 23 def restore_mode input.echo = true rescue Errno::ENOTTY end
(see HighLine::Terminal#terminal_size)
# File lib/highline/terminal/io_console.rb, line 11 def terminal_size output.winsize.reverse rescue Errno::ENOTTY end