Skip to content

Bound WSL terminal detection and handle inconclusive probes safely - #45811

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/39e980b0d7cf3d6716ee61597d6002b0fd59651e
Sep 16, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/39e980b0d7cf3d6716ee61597d6002b0fd59651e

Conversation

@copyberry

@copyberry copyberry Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Bound WSL terminal detection and handle inconclusive probes safely

Why

WSL interop can block while launching the Windows terminal probe, stalling TUI startup. Inconclusive detection can also enable keyboard enhancements that break dead-key composition in VS Code on WSL.

What changed

  • Give the Windows TERM_PROGRAM probe a one-second deadline, with launch and cleanup handled on a worker thread. Cache the result, including timeouts, and kill and reap probes that outlive the deadline once launch returns.
  • Distinguish VS Code, other terminals, and unknown detection results. Disable keyboard enhancements on WSL for VS Code or unknown results, while preserving the CODEX_TUI_DISABLE_KEYBOARD_ENHANCEMENT override.

Testing

Add regression tests for probe output and exit status, failed launches, timeouts during launch and execution, and child cleanup. Extend detection and override tests to cover unknown results.

…45811)

## Why

WSL interop can block while launching the Windows terminal probe, stalling TUI startup. Inconclusive detection can also enable keyboard enhancements that break dead-key composition in VS Code on WSL.

## What changed

- Give the Windows `TERM_PROGRAM` probe a one-second deadline, with launch and cleanup handled on a worker thread. Cache the result, including timeouts, and kill and reap probes that outlive the deadline once launch returns.
- Distinguish VS Code, other terminals, and unknown detection results. Disable keyboard enhancements on WSL for VS Code or unknown results, while preserving the `CODEX_TUI_DISABLE_KEYBOARD_ENHANCEMENT` override.

## Testing

Add regression tests for probe output and exit status, failed launches, timeouts during launch and execution, and child cleanup. Extend detection and override tests to cover unknown results.

GitOrigin-RevId: 39e980b0d7cf3d6716ee61597d6002b0fd59651e
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/39e980b0d7cf3d6716ee61597d6002b0fd59651e branch from 642d58d to 8f9d0e4 Compare September 16, 2026 00:13
@copyberry
copyberry Bot merged commit 8f9d0e4 into main Sep 16, 2026
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/39e980b0d7cf3d6716ee61597d6002b0fd59651e branch September 16, 2026 00:13
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant