diff options
Diffstat (limited to 'lib/reline/general_io.rb')
-rw-r--r-- | lib/reline/general_io.rb | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/lib/reline/general_io.rb b/lib/reline/general_io.rb index 3fafad5c6e..0ac1c6c56d 100644 --- a/lib/reline/general_io.rb +++ b/lib/reline/general_io.rb @@ -1,10 +1,15 @@ -require 'timeout' require 'io/wait' class Reline::GeneralIO + RESET_COLOR = '' # Do not send color reset sequence + def self.reset(encoding: nil) @@pasting = false - @@encoding = encoding + if encoding + @@encoding = encoding + elsif defined?(@@encoding) + remove_class_variable(:@@encoding) + end end def self.encoding @@ -31,7 +36,11 @@ class Reline::GeneralIO @@input = val end - def self.getc + def self.with_raw_input + yield + end + + def self.getc(_timeout_second) unless @@buf.empty? return @@buf.shift end @@ -50,13 +59,19 @@ class Reline::GeneralIO end def self.get_screen_size - [1, 1] + [24, 80] end def self.cursor_pos Reline::CursorPos.new(1, 1) end + def self.hide_cursor + end + + def self.show_cursor + end + def self.move_cursor_column(val) end @@ -87,14 +102,6 @@ class Reline::GeneralIO @@pasting end - def self.start_pasting - @@pasting = true - end - - def self.finish_pasting - @@pasting = false - end - def self.prep end |