module Pry::Helpers

def self.tablify_to_screen_width(things, options, pry_instance = Pry.new)

def self.tablify_to_screen_width(things, options, pry_instance = Pry.new)
  options ||= {}
  things = things.compact
  if (indent = options[:indent])
    usable_width = pry_instance.output.width - indent.size
    tablify(things, usable_width, pry_instance).to_s.gsub(/^/, indent)
  else
    tablify(things, pry_instance.output.width, pry_instance).to_s
  end
end