start method
Starts executable in its own process group, so a Ctrl+C typed in the
terminal doesn't reach it. Metro stops it with LiveProcess.interrupt
once the playbook has finished.
Implementation
Future<LiveProcess> start(
String executable,
List<String> arguments, {
Map<String, String>? environment,
}) async {
final Process process = await Process.start(
executable,
arguments,
environment: environment,
mode: ProcessStartMode.detachedWithStdio,
);
return LiveProcess(
stdout: process.stdout,
stderr: process.stderr,
signal: (ProcessSignal signal) => Process.killPid(process.pid, signal),
);
}