ruby-changes:59589
From: Yusuke <ko1@a...>
Date: Wed, 1 Jan 2020 06:39:21 +0900 (JST)
Subject: [ruby-changes:59589] 337ba56aff (master): [ruby/reline] Degenerate the terminal size to [$LINES, $COLUMNS] if it is unknown
https://git.ruby-lang.org/ruby.git/commit/?id=337ba56aff From 337ba56aff37d34896c0dd091f1bcfb4a556126b Mon Sep 17 00:00:00 2001 From: Yusuke Endoh <mame@r...> Date: Sun, 29 Dec 2019 09:01:00 +0900 Subject: [ruby/reline] Degenerate the terminal size to [$LINES, $COLUMNS] if it is unknown This is a workaround for https://github.com/ruby/irb/issues/50 https://github.com/ruby/reline/commit/5725677d1a diff --git a/lib/reline/ansi.rb b/lib/reline/ansi.rb index 8d83da8..27157f0 100644 --- a/lib/reline/ansi.rb +++ b/lib/reline/ansi.rb @@ -50,7 +50,11 @@ class Reline::ANSI https://github.com/ruby/ruby/blob/trunk/lib/reline/ansi.rb#L50 end def self.get_screen_size - @@input.winsize + s = @@input.winsize + return s if s[0] > 0 && s[1] > 0 + s = [ENV["LINES"].to_i, ENV["COLUMNS"].to_i] + return s if s[0] > 0 && s[1] > 0 + [24, 80] rescue Errno::ENOTTY [24, 80] end -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/