Skip to content

feat(console): Linux PTY input, resize and clean chat handoff - #254

Merged
AetherAI3 merged 1 commit into
mainfrom
fix/246-linux-pty-handoff
Oct 1, 2026
Merged

AetherAI3 merged 1 commit into
mainfrom
fix/246-linux-pty-handoff

Conversation

@AetherAI3

@AetherAI3 AetherAI3 commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

Closes #246.

The coding console can now hand its terminal to an explicit /terminal <command> and return to chat after exit or Ctrl+]. /terminal-attach, /terminal-status and /terminal-stop expose the one active session. Input, Ctrl+C and resize reach the child PTY; output streams live. Console repaint/input pause while attached, terminal modes restore on return, and a detached exit preserves the composer draft.

A Python 3 standard-library bridge creates the Linux controlling terminal, cleans up owned process groups and reports launch/crash failures without replay. Detached terminals reserve local execution authority: model/user tools refuse until stop/exit, and interactive edits remain user-owned for automatic commits. Noninteractive !command and model tools retain existing bounded capture. This is a local user console command; it grants no Online/ATS authority.

Requirements and limits: Linux, Python 3 and TTY stdin/stdout; other platforms/pipes use !command. The PTY starts in the selected shell cwd with a filtered environment, without inheriting persistent shell exports/functions. Reattachment replays only the latest 8 KiB; sessions do not survive console exit.

Validation on latest main (including #247): eight real Linux PTY tests cover input/dimensions/progress, resize, foreground Ctrl+C, stop cleanup, missing helper, crash/restart, ownership blocking, detach/reattach/raw-mode restoration, normal model chat and draft preservation after detached crash. TypeScript build, generated docs, production package verification and release truth pass. The final isolated full suite passes: 2,927 passed, 11 skipped, 0 failed (2,938 total, 167.9 seconds). Earlier runs exposed intermittent spawn-fixture failures; the final run used no concurrent builds. Hosted CI did not execute: failing jobs have no runner or steps, and clean install is skipped. No Windows or hosted CodeQL pass is claimed. Exact published source tree: 097cfdf917a8e494a687dbb34c59d8597b163f66.

Add stdin, resize, interrupt, detach/reattach, stop, process cleanup and terminal restoration with conservative user edit attribution.

Closes #246.

@AetherAI3 AetherAI3 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation self-review against #246: explicit user PTY authority and visible session ID; one input owner and paused composer/status paints; forwarded input/Ctrl+C/resize; distinct detach/stop/console-exit; normal, failed-launch and crash restoration; preserved draft after detached crash; no automatic replay; one active PTY reserves tool execution and attributes changes to the user. Linux/Python 3/TTY requirements and !command fallback documented. Noninteractive bounded capture and latest #247 changes preserved.

Exact reviewed/tested tree 097cfdf917a8e494a687dbb34c59d8597b163f66 matches the GitHub commit. Eight real PTY tests and final full suite pass: 2,927 passed, 11 skipped, 0 failed. Build/typecheck, docs check, production package and release truth pass. Hosted CI jobs failed before runner allocation (runner_id=0, steps=[]); clean-install skipped. This is a self-review, not an independent approval.

@AetherAI3
AetherAI3 merged commit e17ff4c into main Oct 1, 2026
2 of 7 checks passed
@AetherAI3
AetherAI3 deleted the fix/246-linux-pty-handoff branch October 1, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature] Linux terminal: add PTY input, resize and clean console handoff

1 participant