Skip to content

Fix interactive key reader fd flags - #34

Merged
dapi merged 2 commits into
masterfrom
codex/gh-33
Jul 24, 2026
Merged

Fix interactive key reader fd flags#34
dapi merged 2 commits into
masterfrom
codex/gh-33

Conversation

@dapi

@dapi dapi commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Fixes #33.

What changed

The Unix interactive key reader now opens the controlling terminal as a separate file description before enabling O_NONBLOCK. Teardown restores and closes only that reader descriptor, leaving stdin and any stdout/stderr descriptors sharing the original open-file description untouched.

Root cause

O_NONBLOCK is an open-file-description flag. Setting it on stdin made stdout non-blocking when both descriptors shared that description, allowing normal terminal backpressure to abort the workflow.

Routing and validation

  • Flow: Bug Fix — the issue documents an existing expected behavior and a reproducible regression.
  • Validation profile: standard — executable terminal-I/O behavior; no security, persistent-data, deployment, or cross-system triggers.
  • Regression coverage: models a stdout descriptor sharing stdin open-file-description flags and proves key-reader setup does not change them.

Verification

  • go test ./internal/terminal
  • go test ./...
  • go vet ./...
  • make docs-lint
  • git diff --check

No manual terminal smoke was run in the non-interactive execution environment.

@dapi
dapi marked this pull request as ready for review July 24, 2026 21:09
@dapi
dapi merged commit 151a0c3 into master Jul 24, 2026
1 check passed
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.

Fix interactive view setting stdout non-blocking on shared terminal fd

1 participant