# File lib/pry-remote-em.rb, line 34
    def self.popen3(cmd, handler=nil, *args)
      klass = klass_from_handler(Connection, handler, *args)
      w     = Shellwords::shellwords(cmd)
      w.unshift(w.first) if w.first

      new_stderr = $stderr.dup
      rd, wr     = IO::pipe

      $stderr.reopen wr
      s = invoke_popen(w)
      $stderr.reopen new_stderr

      klass.new(s, *args).tap do |c|
        EM.attach(rd, Popen3StderrHandler, c)
        @conns[s] = c
        yield(c) if block_given?
      end
    end