def pop_merge_buffer
      raise Shells::NotRunning unless running?
      # almost a standard pop, however we want to merge history with current.
      debug 'Merging buffer <<'
      sync do
        hist_stdout, hist_stderr, hist_output = (output_stack.pop || [])
        if hist_stdout
          self.stdout = hist_stdout + stdout
        end
        if hist_stderr
          self.stderr = hist_stderr + stderr
        end
        if hist_output
          self.output = hist_output + output
        end
      end
    end
def pop_merge_buffer
      raise Shells::NotRunning unless running?
      # almost a standard pop, however we want to merge history with current.
      debug 'Merging buffer <<'
      sync do
        hist_stdout, hist_stderr, hist_output = (output_stack.pop || [])
        if hist_stdout
          self.stdout = hist_stdout + stdout
        end
        if hist_stderr
          self.stderr = hist_stderr + stderr
        end
        if hist_output
          self.output = hist_output + output
        end
      end
    end
Pops the buffers and merges the captured output.

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