You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: expose foregroundPid accessor on UnixTerminal
Add a `foregroundPid` getter that returns `tcgetpgrp(fd)` on the pty
master fd, exposing the pid of the foreground process group attached
to the pty (or `undefined` on failure).
This is the same syscall the existing `pty_getproc` already invokes
internally to resolve the foreground process *name* — it's just
returning the pid instead of throwing it away.
Useful for callers that need to identify which process is currently
in the foreground of a terminal (e.g. to detect that an agent like
claude-code is running, where the process name resolves to "node").
Cross-platform: works on both Linux and macOS via tcgetpgrp(3).
Not exposed on Windows (no equivalent ConPTY concept).
0 commit comments