Skip to content

fix(server): stop Windows terminal processes when closing - #207

Merged
leoisadev1 merged 2 commits into
mainfrom
fix/windows-terminal-process-close
Sep 10, 2026
Merged

fix(server): stop Windows terminal processes when closing#207
leoisadev1 merged 2 commits into
mainfrom
fix/windows-terminal-process-close

Conversation

@leoisadev1

Copy link
Copy Markdown
Member

Problem

Closing a Windows terminal can hide the session while child processes keep running, including HTTP servers that still hold their ports. The terminal manager sends SIGTERM/SIGKILL, but node-pty rejects POSIX signals on Windows.

Changes

NodePtyAdapter omits the signal on Windows so node-pty runs its native process-tree termination. Linux and macOS keep their existing signal behavior. The change stays in the server adapter, so every client that closes a terminal gets it.

Adapted from pingdotgg#10771. Process ownership, history, and Akeru session fields are unchanged.

Scope

This PR is Windows terminal close only.

Covered here:

Still assigned to this handoff, in later PRs:

Server history bounds already landed in a separate PR.

Verification

  • vp test run apps/server/src/terminal/NodePtyAdapter.test.ts: 6 passed, including Windows, Linux, and macOS kill semantics. The Windows case fails if a signal is passed through.
  • vp lint on the two adapter files: clean.

No Windows host in this environment, so native process-tree termination was not exercised on a real Windows machine. Linux/macOS signal behavior is covered by the same adapter tests.

Implemented and verified by Grok 4.6 High in Grok Build via Orca.

Omit POSIX signals on Windows so node-pty can terminate the process
tree. Linux and macOS keep SIGTERM/SIGKILL.

Adapted from pingdotgg#10771.
@vercel

vercel Bot commented Sep 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
akeru-bot-landing Skipped Skipped Sep 10, 2026 5:26pm UTC

Request Review

@github-actions github-actions Bot added size:XS vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Sep 10, 2026
@greptile-apps

greptile-apps Bot commented Sep 10, 2026

Copy link
Copy Markdown

Greptile Summary

Summary

  • Updates PTY termination to use platform-appropriate behavior.
  • Preserves signal forwarding on Linux and macOS while avoiding POSIX signal arguments on Windows.
  • Adds coverage for Windows, Linux, and macOS kill semantics.

Confidence Score: 5/5

Safe to merge.

There are no outstanding findings.

Reviews (2): Last reviewed commit: "Merge branch 'main' into fix/windows-ter..." | Re-trigger Greptile

@leoisadev1
leoisadev1 merged commit 657886f into main Sep 10, 2026
11 checks passed
@leoisadev1
leoisadev1 deleted the fix/windows-terminal-process-close branch September 10, 2026 19:33
@github-actions github-actions Bot mentioned this pull request Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant