{"record":{"id":"0a5d85fde17065d0","repo":"deepseek-ai/deepseek-harness","slug":"refusing-to-sigkill-the-terminal-shell-terminate-0a5d85","errorCode":null,"errorMessage":"refusing to SIGKILL the terminal shell; terminate the terminal session instead","messagePattern":"refusing to SIGKILL the terminal shell; terminate the terminal session instead","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/subprocess/subprocess-local/src/terminal.ts","lineNumber":101,"sourceCode":"  // Local inspection is synchronous; the seam returns a promise for remote transports.\n  // oxlint-disable-next-line typescript/require-await -- Preserve promise rejection semantics at the async provider contract.\n  async inspectForeground(): Promise<SubprocessTerminalForeground | undefined> {\n    this.descendants()\n    const processGroupId = this.inspector.foregroundPgid(this.pid)\n    if (processGroupId === undefined) return undefined\n    return {\n      processGroupId,\n      inputWaiting: this.inspector.isStdinWaiting(processGroupId),\n    }\n  }\n\n  async signalForeground(signal: SubprocessTerminalSignal): Promise<number> {\n    const foreground = await this.inspectForeground()\n    if (foreground === undefined) {\n      throw new Error(`cannot resolve foreground process group for terminal ${this.pid}`)\n    }\n    if (signal === 'SIGKILL' && foreground.processGroupId === this.pid) {\n      throw new Error('refusing to SIGKILL the terminal shell; terminate the terminal session instead')\n    }\n    if (this.platform === 'win32') {\n      if (signal === 'SIGINT') {\n        // Windows has no process-group signalling: a `\\x03` input write is the\n        // Ctrl-C delivery path conhost turns into a console-wide CTRL_C event\n        // for attached processes. node-pty's signal kills throw on Windows, so\n        // no signal ever reaches the inspector.\n        this.terminal.write('\\x03')\n        return foreground.processGroupId\n      }\n      if (signal === 'SIGTSTP' || signal === 'SIGHUP') {\n        throw new Error(`signal ${signal} is unsupported on Windows; only SIGINT, SIGTERM, and SIGKILL are available`)\n      }\n    }\n    this.inspector.signalGroup(foreground.processGroupId, signal)\n    return foreground.processGroupId\n  }\n","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/subprocess/subprocess-local/src/terminal.ts#L83-L119","documentation":"Error \"refusing to SIGKILL the terminal shell; terminate the terminal session instead\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/subprocess/subprocess-local/src/terminal.ts:101 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Terminate the terminal session instead of SIGKILLing its shell process."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}