def buffer_output(&block) #:doc:
      raise Shells::NotRunning unless running?
      block ||= Proc.new { }
      stdout_received do |data|
        self.last_output = Time.now
        append_stdout strip_ansi_escape(data), &block
      end
      stderr_received do |data|
        self.last_output = Time.now
        append_stderr strip_ansi_escape(data), &block
      end
    end
def buffer_output(&block) #:doc:
      raise Shells::NotRunning unless running?
      block ||= Proc.new { }
      stdout_received do |data|
        self.last_output = Time.now
        append_stdout strip_ansi_escape(data), &block
      end
      stderr_received do |data|
        self.last_output = Time.now
        append_stderr strip_ansi_escape(data), &block
      end
    end
Sets the block to call when data is received.

 If no block is provided, then the shell will simply log all output from the program.
 If a block is provided, it will be passed the data as it is received.  If the block
 returns a string, then that string will be sent to the shell.

 This method is called internally in the +exec+ method, but there may be legitimate use
 cases outside of that method as well.