@code-yeongyu/senpi-pty 2026.10.18 → 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.
@@ -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.";
@@ -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
- if (pid !== undefined && process.platform !== "win32") {
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
- if (terminateChildTree(this.child, signal) === "group") {
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.` };
package/dist/screen.js CHANGED
@@ -124,6 +124,7 @@ export class TerminalScreen {
124
124
  for (const operation of pending) {
125
125
  settleOperation(operation.settlers, null);
126
126
  }
127
+ this.terminal.reset();
127
128
  this.terminal.dispose();
128
129
  }
129
130
  createTerminal(cols, rows) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code-yeongyu/senpi-pty",
3
- "version": "2026.10.18",
3
+ "version": "2026.10.19-1",
4
4
  "description": "Typed PTY session loader for Senpi persistent terminals",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",