constructor(
private readonly _onLog?: (level: 'info' | 'warn' | 'error', message: string) => void,
private readonly _graceKillMs = GRACE_KILL_MS,
) {
super();
this._register(this._transport.onExit(e => this._handleExit(e)));
this._transport.stdout.setEncoding?.('utf8');
this._register(this._listenToStdout());
}
private _listenToStdout(): IDisposable {
const text = typeof chunk === 'string' ? chunk : chunk.toString('utf8');
this._buf += text;