codex/codex-rs/terminal-detection
Felipe Coury 637c3227b3 Avoid executing PATH helpers before workspace trust (#42324)
## Why

Automatic startup work and `codex doctor` can run before a workspace is
trusted. A repository-controlled `PATH` must not be able to make those flows
execute workspace-provided helpers.

## What changed

- Resolve helpers used by automatic startup from trusted system installation
  directories, and give plugin-sync Git subprocesses a sanitized environment.
- Make terminal detection environment-only and have doctor inspect executable
  locations without running them. Fetch update metadata with the HTTP client
  instead of `curl`.
- Fall back conservatively when trusted terminal helpers are unavailable,
  including for tmux keyboard enhancement flags.

## Testing

Add black-box coverage with hostile workspace `PATH` entries for startup,
interactive tmux startup, support log collection, doctor, and curated plugin
sync. Add unit coverage for trusted executable resolution and bounded update
HTTP responses.

GitOrigin-RevId: 3b8995eb422b60ed53b0386951de59e8f9bfc542
History 2026-09-02 18:34:27 +00:00
..
src Avoid executing PATH helpers before workspace trust (#42324) 2026-09-02 18:34:27 +00:00
BUILD.bazel Move terminal module to terminal-detection crate (#15216) 2026-03-19 14:08:04 -07:00
Cargo.toml Disable empty Cargo test targets (#21584) 2026-05-07 15:44:17 -07:00