     public func execute() throws -> String {
         self.startExecution()
 
+        commandsToKill.append(self)
+
         self.process.waitUntilExit()
+        self.removeFromCommandsToKill()
 
         guard self.process.terminationStatus == 0 else {
             throw LocalUserReportableError(source: "ShellCommand", operation: "executing command", message: "Stopping execution", reason: .user)

        else if captureOutput {
            self.process.standardOutput = Pipe()
        }
    }

    deinit {

            command.process.launch()
        }
    }

    func removeFromCommandsToKill() {
        if let index = commandsToKill.indexOfValue(passing: {$0 === self}) {
            commandsToKill.remove(at: index)
        }
    }
}
#endif
