feat(defterm): Stage A — attach to an externally-created PTY#35
Merged
Conversation
First stage of Default Terminal delegation (T2-13). Adds the ability for agwinterm to host a console session it did NOT spawn — the prerequisite for the Windows default-terminal handoff, where conhost/OpenConsole hands the terminal the pipe/signal handles of an already-running console client. - AttachedPty : IPtyConnection over externally-provided handles (conOut read, conIn write, signal pipe for resize via the ConPTY resize packet, optional client process handle for exit detection). - TerminalSession.Attach(...) wires it into the existing emulator pump / input path; exit is reported on client death or output-pipe EOF. Safe and self-contained: no COM, no registry, nothing system-wide yet. Verified with a raw-pipe test — external output pumps into the emulator and input routes back out the conIn pipe. 110/110 Core, 17/17 Pty. Next: Stage B (out-of-proc ITerminalHandoff3 COM server) and Stage C (set- as-default-terminal registry + OpenConsole), both needing sandbox testing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Stage A of Default Terminal delegation (T2-13) — see
docs/defterm-feasibility.mdfor the full staged plan.Adds the ability for agwinterm to host a console session it did not spawn — the prerequisite for the Windows default-terminal handoff, where conhost/OpenConsole hands the terminal the pipe + signal handles of an already-running console client.
What lands
AttachedPty : IPtyConnectionover externally-provided handles:conOut(read console VT output),conIn(write user input), a signal pipe (resize via the ConPTY resize packet), and an optional client process handle for exit detection.TerminalSession.Attach(...)wires it into the existing emulator pump + input path; exit reports on client death or output-pipe EOF.Safe & self-contained
No COM, no registry, nothing system-wide. This is pure plumbing that's independently testable.
Verification
New raw-pipe test (no real ConPTY/child needed): external output pumps into the emulator and input routes back out the conIn pipe. 110/110 Core, 17/17 Pty.
Next stages (need sandbox testing)
ITerminalHandoff3COM server (CLSID + handoff →Attach)HKCU\Console\%%Startup) + OpenConsole delegation, with a one-click revert🤖 Generated with Claude Code