Work around bug in jruby 1.7 on JVM 7 on Linux [Fixes #732]

OHAI LEAKY ABSTRACTIONS
This commit is contained in:
Conrad Irwin 2012-11-18 00:13:44 -08:00
parent ea4c9aa495
commit 8d2a766a43
1 changed files with 12 additions and 0 deletions

View File

@ -119,3 +119,15 @@ if [[1, 2]].pretty_inspect == "[1]\n"
end
end
end
if defined?(JRUBY_VERSION) && JRUBY_VERSION == "1.7.0"
require 'io/console'
class IO
def winsize
stty_info = `stty -a`
match = stty_info.match(/(\d+) rows; (\d+) columns/) # BSD version of stty, like the one used in Mac OS X
match ||= stty_info.match(/; rows (\d+); columns (\d+)/) # GNU version of stty, like the one used in Ubuntu
[match[1].to_i, match[2].to_i]
end
end
end