kill method

bool kill([
  1. ProcessSignal signal = ProcessSignal.sigterm
])

Sends a ProcessSignal to terminate the process.

If the Script is a Unix-style OS process, pass the given signal to the process. On platforms without signal support, including Windows, the signal is ignored and the process terminates in a platform specific way.

Returns true if the signal is successfully delivered to the Script. Otherwise the signal could not be sent, usually meaning that the process is already dead or the Script doesn't have a signal handler.

Implementation

bool kill([ProcessSignal signal = ProcessSignal.sigterm]) {
  if (_doneCompleter.isCompleted) return false;
  try {
    return _signalHandler(signal);
  } catch (e, s) {
    _handleError(e, s);
    return false;
  }
}