Repository navigation
Conversation
5 of 6 tasks
tony
force-pushed
the
concept/terminal-subprocess
branch
from
December 1, 2026 03:33
e56a9c8 to
d933bf1
Compare
tony
added a commit
that referenced
this pull request
Dec 3, 2026
why: Record the branch's user-visible change in the unreleased notes. what: - Add the #142 entry under What's new in CHANGES
tony
force-pushed
the
concept/terminal-subprocess
branch
from
December 3, 2026 02:55
d933bf1 to
19200f7
Compare
tony
force-pushed
the
concept/terminal-subprocess
branch
from
December 3, 2026 23:58
19200f7 to
4e848c1
Compare
7 tasks done
tony
added a commit
that referenced
this pull request
Dec 5, 2026
why: Synchronous callers need to exchange input and frames with a child. what: - Expose the terminal subprocess context manager and its PTY adapters. - Honor the caller's temporary directory for terminal socket setup. - Exercise teardown and frame reads through the public API. Adapted from #142 at 4e848c1.
tony
force-pushed
the
concept/terminal-subprocess
branch
from
December 5, 2026 14:56
a90f825 to
23b7f2c
Compare
tony
force-pushed
the
concept/terminal-subprocess
branch
from
December 5, 2026 15:06
23b7f2c to
dcf6243
Compare
why: Reuse terminal initialization, slave PTY configuration, and reader attachment between open_pty and the Darwin session-leader launcher without duplicating termios or OSC 7 setup. what: - Extract _resolve_python_executable, _make_pty_terminal, _prepare_pty_fds, and _child_pty_env in libvt.aio._pty. - Add PtySession._start_reading and call it from open_pty.
why: Synchronous tests need real PTY or ConPTY interaction, bounded output capture, and separate child-exit vs terminal-EOF waits on top of libvt's async sessions and recorder protocol. what: - Add libvt.contrib.subprocess with VT (raw_limit >= 0), Capture, CompletedTerminal, TerminalProcess, CalledTerminalError, TerminalTimeoutExpired, open_terminal, and run_terminal without re-exporting stdlib Popen or run. - Resolve FlightRecorder via find_flight_recorder and implement SupportsVtTarget on Capture and TerminalProcess. - Add a single-trampoline Darwin PTY session owner over socket.socketpair and a Win32 ConPTY backend. - Document libvt.contrib.subprocess in docs, README, and CHANGES, and add cross-platform subprocess and Darwin helper tests. Refs #106
tony
force-pushed
the
concept/terminal-subprocess
branch
from
December 5, 2026 15:27
dcf6243 to
6776ee2
Compare
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
open_terminal().run_terminal().Popenandrunas their actual typed standard library callables.Closes #106.
Process exit and terminal EOF
A direct child can exit while a worker still reads and writes the inherited terminal.
wait()returns the direct child's status.wait_eof()collects the worker's final output. Closing the handle owns the terminal and reaps the direct child. A POSIX descendant that ignores hangup may survive a close or timeout after its parent exits.On macOS a helper owns the controlling terminal until the session closes. The helper uses the process temporary directory for its control socket. Set a short
TMPDIRif the path exceeds the Unix socket address limit. Native tests cover descendant I/O, the foreground process group, Ctrl+C status and helper cleanup.Windows terminal mode uses
ReleasePseudoConsoleto observe EOF when the final console client disconnects. Microsoft provides that API starting with Windows 11 24H2 and Windows Server 2025, build 26100. Windows API referenceTry it
Run the synchronous input, resize, status, and EOF cases from a libvt checkout.
$ gh pr checkout 142 && uv run --frozen --all-groups --all-extras pytest -q tests/test_subprocess.pyTest plan