def run_as_pty(command)
      Strainer.ui.debug 'Using PTY'
      PTY.spawn(command) do |r, _, pid|
        begin
          r.sync
          r.each_line { |line| speak line }
        rescue Errno::EIO => e
          # Ignore this. Otherwise errors will be thrown whenever
          # the process is closed
        ensure
          ::Process.wait pid
        end
      end
    end
def run_as_pty(command)
      Strainer.ui.debug 'Using PTY'
      PTY.spawn(command) do |r, _, pid|
        begin
          r.sync
          r.each_line { |line| speak line }
        rescue Errno::EIO => e
          # Ignore this. Otherwise errors will be thrown whenever
          # the process is closed
        ensure
          ::Process.wait pid
        end
      end
    end
Run a command using PTY

 @param [String] command
   the command to run