@code-yeongyu/senpi-pty 2026.10.18-1 → 2026.10.19-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/pipe-fallback.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export declare function shouldUsePipeFallback(nativeLoadResult: NativePtyLoadRes
|
|
|
39
39
|
* the group is already gone, it still falls back to a direct kill, so the
|
|
40
40
|
* child is never left running.
|
|
41
41
|
*/
|
|
42
|
-
export declare function terminateChildTree(child: Pick<ChildProcessHandle, "pid" | "kill">, signal: NodeJS.Signals): "group" | "direct";
|
|
42
|
+
export declare function terminateChildTree(child: Pick<ChildProcessHandle, "pid" | "kill">, signal: NodeJS.Signals): "group" | "direct" | "none";
|
|
43
43
|
export declare class PipeFallbackSession {
|
|
44
44
|
readonly backend = "pipe-fallback";
|
|
45
45
|
readonly note = "Running with child_process pipe fallback because no PTY backend is active; terminal screen state and resize are unavailable.";
|
package/dist/pipe-fallback.js
CHANGED
|
@@ -18,7 +18,10 @@ export function shouldUsePipeFallback(nativeLoadResult, env = process.env) {
|
|
|
18
18
|
*/
|
|
19
19
|
export function terminateChildTree(child, signal) {
|
|
20
20
|
const pid = child.pid;
|
|
21
|
-
|
|
21
|
+
// A child that never started has no pid; on Node < 24.22 / 26.10 its kill() signals our own process group.
|
|
22
|
+
if (pid === undefined)
|
|
23
|
+
return "none";
|
|
24
|
+
if (process.platform !== "win32") {
|
|
22
25
|
try {
|
|
23
26
|
process.kill(-pid, signal);
|
|
24
27
|
return "group";
|
|
@@ -208,7 +211,15 @@ export class PipeFallbackSession {
|
|
|
208
211
|
return { ok: true, note: `Sent ${signal} to child_process pipe fallback session.` };
|
|
209
212
|
}
|
|
210
213
|
}
|
|
211
|
-
|
|
214
|
+
const route = terminateChildTree(this.child, signal);
|
|
215
|
+
if (route === "none") {
|
|
216
|
+
return {
|
|
217
|
+
ok: false,
|
|
218
|
+
code: "not_started",
|
|
219
|
+
note: "Cannot kill pipe fallback session: its process never started.",
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
if (route === "group") {
|
|
212
223
|
return { ok: true, note: `Sent ${signal} to child_process pipe fallback process group (pgid ${pid}).` };
|
|
213
224
|
}
|
|
214
225
|
return { ok: true, note: `Sent ${signal} to child_process pipe fallback session.` };
|
|
Binary file
|
|
Binary file
|