def page
      return if not $stdout.tty?

      read_io, write_io = IO.pipe

      if Kernel.fork
        $stdin.reopen(read_io)
        read_io.close
        write_io.close

        # Don't page if the input is short enough
        ENV['LESS'] = 'FSRX'

        # Wait until we have input before we start the pager
        Kernel.select [$stdin]

        pager = Pager.pager_command

        Kernel.exec pager rescue Kernel.exec "/bin/sh", "-c", pager
      else
        # Child process
        $stdout.reopen(write_io)
        $stderr.reopen(write_io) if $stderr.tty?
        write_io.close
        read_io.close
      end
    end
def page
      return if not $stdout.tty?

      read_io, write_io = IO.pipe

      if Kernel.fork
        $stdin.reopen(read_io)
        read_io.close
        write_io.close

        # Don't page if the input is short enough
        ENV['LESS'] = 'FSRX'

        # Wait until we have input before we start the pager
        Kernel.select [$stdin]

        pager = Pager.pager_command

        Kernel.exec pager rescue Kernel.exec "/bin/sh", "-c", pager
      else
        # Child process
        $stdout.reopen(write_io)
        $stderr.reopen(write_io) if $stderr.tty?
        write_io.close
        read_io.close
      end
    end
Pages output using configured pager.