def handle_input(input)
      raise ArgumentError unless input.instance_of?(String)
      begin
        output = ''
        case input.strip
        when PuppetDebugger::InputResponders::Commands.command_list_regex
          args = input.split(' ')
          command = args.shift
          plugin = PuppetDebugger::InputResponders::Commands.plugin_from_command(command)
          output = plugin.execute(args, self)
          return out_buffer.puts output
        when '_'
          output = " => #{@last_item}"
        else
          result = puppet_eval(input)
          @last_item = result
          output = normalize_output(result)
          output = output.nil? ? '' : output.ai
        end
      rescue PuppetDebugger::Exception::InvalidCommand => e
        output = e.message.fatal
      rescue LoadError => e
        output = e.message.fatal
      rescue Errno::ETIMEDOUT => e
        output = e.message.fatal
      rescue ArgumentError => e
        output = e.message.fatal
      rescue Puppet::ResourceError => e
        output = e.message.fatal
      rescue Puppet::Error => e
        output = e.message.fatal
      rescue Puppet::ParseErrorWithIssue => e
        output = e.message.fatal
      rescue PuppetDebugger::Exception::FatalError => e
        output = e.message.fatal
        out_buffer.puts output
        exit 1 # this can sometimes causes tests to fail
      rescue PuppetDebugger::Exception::Error => e
        output = e.message.fatal
      end
      unless output.empty?
        out_buffer.print ' => '
        out_buffer.puts output unless output.empty?
        exec_hook :after_output, out_buffer, self, self
      end
    end
def handle_input(input)
      raise ArgumentError unless input.instance_of?(String)
      begin
        output = ''
        case input.strip
        when PuppetDebugger::InputResponders::Commands.command_list_regex
          args = input.split(' ')
          command = args.shift
          plugin = PuppetDebugger::InputResponders::Commands.plugin_from_command(command)
          output = plugin.execute(args, self)
          return out_buffer.puts output
        when '_'
          output = " => #{@last_item}"
        else
          result = puppet_eval(input)
          @last_item = result
          output = normalize_output(result)
          output = output.nil? ? '' : output.ai
        end
      rescue PuppetDebugger::Exception::InvalidCommand => e
        output = e.message.fatal
      rescue LoadError => e
        output = e.message.fatal
      rescue Errno::ETIMEDOUT => e
        output = e.message.fatal
      rescue ArgumentError => e
        output = e.message.fatal
      rescue Puppet::ResourceError => e
        output = e.message.fatal
      rescue Puppet::Error => e
        output = e.message.fatal
      rescue Puppet::ParseErrorWithIssue => e
        output = e.message.fatal
      rescue PuppetDebugger::Exception::FatalError => e
        output = e.message.fatal
        out_buffer.puts output
        exit 1 # this can sometimes causes tests to fail
      rescue PuppetDebugger::Exception::Error => e
        output = e.message.fatal
      end
      unless output.empty?
        out_buffer.print ' => '
        out_buffer.puts output unless output.empty?
        exec_hook :after_output, out_buffer, self, self
      end
    end
this method handles all input and expects a string of text.