Bound embedded surface process teardown - #184
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthroughThe change adds APIs for requesting surface child-process termination and querying VT stream state. Surface teardown now uses bounded POSIX process-group shutdown with SIGHUP-to-SIGKILL escalation. VT tests cover complete and incomplete parser input. ChangesSurface process termination
VT stream ground-state API
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant EmbeddedSurface
participant CoreSurface
participant POSIXProcessGroup
EmbeddedSurface->>CoreSurface: request process termination
CoreSurface->>POSIXProcessGroup: send SIGHUP
POSIXProcessGroup-->>CoreSurface: exit or remain active
CoreSurface->>POSIXProcessGroup: send SIGKILL after grace period
POSIXProcessGroup-->>CoreSurface: reaped child process
EmbeddedSurface->>EmbeddedSurface: complete surface destruction
Possibly related PRs
Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Supports manaflow-ai/cmux#9573.
Verification
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Bound embedded surface teardown to avoid hangs and provide a pre-free API to retire a surface and shut down its child process. Adds a VT stream “ground” check for safe snapshot boundaries, meeting the needs in
manaflow-ai/cmux#9573.New Features
ghostty_surface_request_process_termination()retires a surface from app routing and starts child-process shutdown; idempotent; still callghostty_surface_free().ghostty_terminal_vt_stream_is_ground()reports parser/UTF‑8 ground state to snapshot VT safely (required by the current cmux parent pin).Migration
ghostty_surface_request_process_termination(surface)beforeghostty_surface_free(surface); safe to call multiple times.ghostty_terminal_vt_stream_is_ground(terminal)returns true.Written for commit 5b20c62. Summary will update on new commits.
Summary by CodeRabbit
New Features
Bug Fixes