def size_from_java(verbose: nil)
      return unless jruby?
      require 'java'
      java_import 'jline.TerminalFactory'
      terminal = TerminalFactory.get
      size = [terminal.get_height, terminal.get_width]
      return size if nonzero_column?(size[1])
    rescue
      warn 'failed to import java terminal package' if verbose
    end
def size_from_java(verbose: nil)
      return unless jruby?
      require 'java'
      java_import 'jline.TerminalFactory'
      terminal = TerminalFactory.get
      size = [terminal.get_height, terminal.get_width]
      return size if nonzero_column?(size[1])
    rescue
      warn 'failed to import java terminal package' if verbose
    end
Determine terminal size on jruby using native Java libs

 @return [nil, Array[Integer, Integer]]

 @api private