Skip to content

Implement a bounded macOS and Linux PTY capture adapter #58

Closed

Description

@morluto

Problem

Pipe-based subprocess capture does not reproduce terminal state, resizing, signal delivery, or interactive CLI behavior.

Outcome

Implement a true PTY adapter using a small Python standard-library helper on macOS/Linux.

Scope

  • Create an owned session and process group.
  • Apply timed input, resize, and signal events.
  • Capture ordered frames with relative monotonic timing.
  • Bound duration, frame count, bytes, and idle time.
  • Propagate cancellation.
  • Return exit code or terminating signal.
  • Report typed unavailability on Windows until ConPTY exists.

Safety

Use argument arrays, never shell interpolation. Run only the approved absolute executable. Inherit only allowlisted environment keys. Redact secret-derived content before evidence storage.

Acceptance criteria

Fixtures prove raw/canonical terminal modes, Unicode, resize handling, Ctrl-C, termination signals, timeout, cancellation, partial output, and descendant cleanup. The helper protocol is framed, bounded, parsed as unknown, and tested against malformed messages.

Dependencies

Parent: #48. Requires scenario contracts and explicit process ownership.

Non-goals

Windows ConPTY, SSH, container execution, or external terminals.

Activity

  1. added
    enhancement
    P0: critical
    area: server
    area: build
    roadmap
    on Jul 12, 2026
  2. morluto commented on Jul 17, 2026

    @morluto
    OwnerAuthor

    Completed on current main. ProcessHarness uses node-pty to own a PTY/session and bounded timed events; ProcessCaptureLifecycle and ProcessOwnership provide cleanup and typed host availability. The process-capture tests cover PTY behavior, Unicode, resize, signals, denial, timeout, cancellation, and descendants. ConPTY remains a separately declared Windows availability gap rather than part of this shipped Unix/macOS outcome.

  3. added
    area: runtime
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0: criticalarea: buildarea: runtimearea: serverenhancementroadmap

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions