class Reline::Dumb
Constants
- RESET_COLOR
Public Class Methods
Source
# File lib/reline/io/dumb.rb, line 6 def initialize(encoding: nil) @input = STDIN @buf = [] @pasting = false @encoding = encoding @screen_size = [24, 80] end
Public Instance Methods
Source
# File lib/reline/io/dumb.rb, line 62 def cursor_pos Reline::CursorPos.new(0, 0) end
Source
# File lib/reline/io/dumb.rb, line 18 def encoding if @encoding @encoding elsif RUBY_PLATFORM =~ /mswin|mingw/ Encoding::UTF_8 else @input.external_encoding || Encoding::default_external end end
Source
# File lib/reline/io/dumb.rb, line 58 def get_screen_size @screen_size end
Source
# File lib/reline/io/dumb.rb, line 39 def getc(_timeout_second) unless @buf.empty? return @buf.shift end c = nil loop do Reline.core.line_editor.handle_signal result = @input.wait_readable(0.1) next if result.nil? c = @input.read(1) break end c&.ord end
Source
# File lib/reline/io/dumb.rb, line 72 def move_cursor_column(val) end
Source
# File lib/reline/io/dumb.rb, line 28 def set_default_key_bindings(_) end
Source
# File lib/reline/io/dumb.rb, line 90 def set_screen_size(rows, columns) @screen_size = [rows, columns] end
Source
# File lib/reline/io/dumb.rb, line 94 def set_winch_handler(&handler) end
Source
# File lib/reline/io/dumb.rb, line 35 def with_raw_input yield end