lib/remedy/console.rb in remedy-0.0.4 vs lib/remedy/console.rb in remedy-0.0.5
- old
+ new
@@ -35,9 +35,19 @@
input.cooked!
rescue NoMethodError
%x{stty -raw echo 2> /dev/null}
end
+ def columns
+ size.last
+ end
+ alias_method :width, :columns
+
+ def rows
+ size.first
+ end
+ alias_method :height, :rows
+
def size
str = [0, 0, 0, 0].pack('SSSS')
if input.ioctl(TIOCGWINSZ, str) >= 0 then
str.unpack('SSSS').first 2
else