You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Export one Rust terminal handle with two clear constructors:
TerminalHandle::attach attaches to an existing persistent PTY session. The handle does not own the child. Closing it detaches.
TerminalHandle::spawn starts a local ephemeral child in an embedded PTY. The handle owns the child. Closing it terminates and reaps the child.
Do not add create_tty. Interactive programs such as lazygit require a pseudo-terminal, terminal geometry, and control-sequence handling. A TTY name describes the wrong operating-system object.
Both constructors return the same deep terminal interface. Fractal must not implement a second terminal emulator or a second focus and input adapter for ephemeral tools.
Attach identity
SessionRef declares a PTY root and session ID.
The pair means the current session at that address.
If a session exits and a replacement uses the same root and ID, a new attach targets the replacement.
Generation can be observed for diagnostics when available.
Generation is not required for discovery, preflight, or attach eligibility.
Each attach and reconnect attempt has a private local AttemptId or epoch.
The handle drops late events from an older attempt before they can update current terminal state.
The current Node PTY can omit generation from list and stats. That omission must not block attach.
Use cases
Attach to a long-lived coding-agent session.
Spawn lazygit in the selected agent workspace.
Spawn tail -f or another short-lived log viewer.
Spawn a shell or interactive maintenance command that should end with its pane or owner.
Outcome
Export one Rust terminal handle with two clear constructors:
Do not add create_tty. Interactive programs such as lazygit require a pseudo-terminal, terminal geometry, and control-sequence handling. A TTY name describes the wrong operating-system object.
Both constructors return the same deep terminal interface. Fractal must not implement a second terminal emulator or a second focus and input adapter for ephemeral tools.
Attach identity
SessionRef declares a PTY root and session ID.
The current Node PTY can omit generation from list and stats. That omission must not block attach.
Use cases
Proposed public shape
This is an interface sketch. Exact Rust names can change. The required property is one handle with explicit ownership and close behavior.
Lifecycle rules
A spawned handle can use an explicit grace policy. It must not become a hidden persistent daemon or an st2-reconciled service.
Input and byte contract
Acceptance
Related