Repository navigation
contrib(feat): Drive terminal subprocesses - #142
Merged
Merged
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
tony
force-pushed
the
concept/terminal-subprocess
branch
from
December 5, 2026 15:27
dcf6243 to
6776ee2
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.
tony
marked this pull request as ready for review
December 5, 2026 18:05
tony
force-pushed
the
concept/terminal-subprocess
branch
from
December 5, 2026 18:05
6776ee2 to
7ff8a33
Compare
tony
force-pushed
the
concept/terminal-subprocess
branch
from
December 5, 2026 18:08
7ff8a33 to
4fb89d2
Compare
why: Synchronous callers and test suites need a direct way to spawn interactive programs inside a POSIX PTY or Windows ConPTY, wait for committed frames, send keys or mouse events, drain backpressure, and reap children without managing an asyncio event loop. what: - Add libvt.contrib.subprocess with open_terminal(), run_terminal(), VT, Capture, CompletedTerminal, TerminalProcess (with send_event(), drain(), Buffer inputs, SupportsVtTarget, and LibVtError-derived exceptions), backed by a decoupled daemon _TerminalOwner with weakref.finalize and atexit shutdown so unclosed handles never hang. - Add single-trampoline macOS socketpair helper (_darwin_pty.py) with race-safe child.kill() handling and pure-Python ctypes ConPTY helper (_conpty.py) sharing _make_pty_terminal, reply flushing, and sync timer updates. - Add unit, PTY, Darwin helper, and import-isolation tests in tests/test_subprocess.py, API docs in docs/api/contrib/subprocess.md, README/architecture/AGENTS/public-api updates, and a CHANGES entry. Fixes #106
tony
force-pushed
the
concept/terminal-subprocess
branch
from
December 5, 2026 18:11
4fb89d2 to
84b0285
Compare
35 of 38 tasks
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.
Add
libvt.contrib.subprocess(open_terminal,run_terminal,TerminalProcess,VT,Capture,CompletedTerminal,CalledTerminalError,TerminalTimeoutExpired) for driving terminal child processes from synchronous Python on POSIX PTYs (Linux, macOS via anonymoussocketpairtrampoline) and Windows ConPTY (ReleasePseudoConsole, Windows 11 24H2 / Server 2025 build 26100+)._make_pty_terminal,_prepare_posix_env,_apply_pty_termios,_set_pty_winsize) fromlibvt.aio._pty._TerminalOwnerthread withweakref.finalizeandatexitreaping so unclosed handles never hang interpreter exit.SupportsVtTarget, full outbounddrain()parity (write_high_water=0),send_event(),Bufferinputs, chunkedrun_terminal(input=...), andLibVtErrorinheritance onCalledTerminalErrorandTerminalTimeoutExpired.TerminalTimeoutErrorvsTerminalTimeoutExpired),TerminalProcessattributes, and cross-platform doctests indocs/api/contrib/subprocess.md,docs/topics/architecture.md,docs/project/public-api.md,README.md,AGENTS.md, andCHANGES.Fixes #106