Skip to content

fix(terminal): detect macOS PTY controller disconnects - #176

Merged
owainlewis merged 1 commit into
mainfrom
codex/issue-175-terminal-disconnect
Sep 8, 2026
Merged

fix(terminal): detect macOS PTY controller disconnects#176
owainlewis merged 1 commit into
mainfrom
codex/issue-175-terminal-disconnect

Conversation

@owainlewis

Copy link
Copy Markdown
Owner

The macOS disconnect monitor requested no poll events, so it missed PTY controller closure.
The editor usually exited later through a failed write, but slower startup exposed the broken monitor as a one-second disconnect timeout.
Request read events and throttle ordinary readiness without consuming input.
Use device identity to preserve /dev/tty exclusion and report classification errors before terminal setup.

Closes #175.
This fixes the terminal failure exposed by #174 without changing test deadlines.

Verification:

  • A new real-PTY regression failed with the old mask (Continue instead of Disconnect) and passes with the fix.
  • Input-preservation and descriptor-classification tests pass.
  • cargo test: 322 unit tests pass, four existing performance tests ignored; eight of ten terminal tests pass locally.
  • The two redirected-input tests fail under the local sandbox; both passed in the earlier GitHub run for fix(highlighting): restore TypeScript and Markdown syntax styles #174. Required CI must pass before merge.
  • cargo fmt --check, all-target Clippy with warnings denied, and release build pass.
  • Release PTY smoke: edit/undo, clean exit, unchanged file, restored terminal settings, and usable shell.

@greptile-apps

greptile-apps Bot commented Sep 8, 2026

Copy link
Copy Markdown

Greptile Summary

The PR fixes macOS PTY controller-disconnect monitoring by requesting read readiness, throttling ordinary readable events without consuming input, and replacing terminal-name lookup with device-identity classification.

  • Propagates descriptor-classification failures before terminal setup.
  • Adds real-PTY coverage for controller hangups and input preservation.
  • Documents the issue, implementation, and verification plan.

Confidence Score: 5/5

The PR appears safe to merge, assuming the required macOS CI checks pass.

The monitor prioritizes explicit disconnect events, preserves readable input, throttles repeated readiness, and includes focused tests for the corrected behavior; no concrete blocking or non-blocking issue remains.

Important Files Changed

Filename Overview
src/terminal.rs Updates terminal descriptor classification and polling behavior, with focused PTY regression tests; no actionable defect was established.
docs/issues/175-plan.md Documents the disconnect-monitoring failure, intended fix, and acceptance criteria.

Reviews (1): Last reviewed commit: "fix(terminal): detect macOS PTY controll..." | Re-trigger Greptile

@owainlewis
owainlewis merged commit dfd7a82 into main Sep 8, 2026
2 checks passed
@owainlewis
owainlewis deleted the codex/issue-175-terminal-disconnect branch September 8, 2026 16:49
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.

[v0.3] Fix macOS PTY disconnect monitoring

1 participant