Work around bug in jruby 1.7 on JVM 7 on Linux [Fixes #732]
OHAI LEAKY ABSTRACTIONS
This commit is contained in:
parent
ea4c9aa495
commit
8d2a766a43
|
@ -119,3 +119,15 @@ if [[1, 2]].pretty_inspect == "[1]\n"
|
||||||
end
|
end
|
||||||
end
|
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
|
||||||
|
|
Loading…
Reference in New Issue