summaryrefslogtreecommitdiff
path: root/lib/irb/input-method.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/irb/input-method.rb')
-rw-r--r--lib/irb/input-method.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/irb/input-method.rb b/lib/irb/input-method.rb
index 7cb211354b..6e87488753 100644
--- a/lib/irb/input-method.rb
+++ b/lib/irb/input-method.rb
@@ -12,6 +12,7 @@
require_relative 'src_encoding'
require_relative 'magic-file'
require_relative 'completion'
+require 'io/console'
require 'reline'
module IRB
@@ -36,6 +37,14 @@ module IRB
end
public :gets
+ def winsize
+ if instance_variable_defined?(:@stdout)
+ @stdout.winsize
+ else
+ [24, 80]
+ end
+ end
+
# Whether this input method is still readable when there is no more data to
# read.
#