feat: set process.title so pty processes are identifiable in ps/top/htop (#48)
Under Node 24+, V8 names the main thread "MainThread", so every pty
process (the bin/pty signal-forwarding wrapper, the CLI, each session
daemon, and the supervisor) shows up as `MainThread` in ps/top/htop/btm.
That makes them indistinguishable from any other Node process and hurts
observability and leak triage.
Set `process.title` early in each entry point so they report a
meaningful name instead:
- bin/pty -> "pty" (signal-forwarding wrapper)
- src/cli.ts -> "pty" (CLI)
- src/server.ts -> "pty-daemon" (session daemon, guard-scoped)
- src/supervisor-entry.ts-> "pty-supervisor" (supervisor)
`process.title` is the only thing that overrides /proc/<pid>/comm, and
only when set from within the running process after V8 init — launch
flags (`node --title`, `exec -a`) do not work. Linux caps comm at 15
chars (TASK_COMM_LEN); all titles stay well under. Each assignment is
wrapped in try/catch so it can never throw. server.ts only sets the
title inside its `argv[1].endsWith("/server.js")` daemon-entry guard,
since the module is also imported as a library (PtyServer).
Adds a Linux-only test asserting a spawned daemon's /proc/<pid>/comm is
"pty-daemon".
Claude-Session: https://claude.ai/code/session_01FKmH5V4zLM7HXsbNohqPV9
Co-authored-by: schickling-assistant <schickling.ventures@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
authored by