WSL: shortcut overlay snapshot tests are non-deterministic

Resolved 💬 0 comments Opened Jan 16, 2026 by slkzgm Closed Jan 28, 2026

What version of Codex is running?

Built from source (codex-rs TUI).

What platform is your computer?

WSL2 (Windows).

What issue are you seeing?

Snapshot tests for the TUI shortcut overlay are non-deterministic under WSL.

On WSL, Codex detects the environment and renders the paste-image shortcut as Ctrl+Alt+V (many terminals intercept Ctrl+V), while non-WSL renders Ctrl+V.

Because the snapshot output depends on this detection, running cargo test -p codex-tui / cargo test -p codex-tui2 under WSL can fail with diffs like:

  • ctrl + v to paste imagesctrl + ⌥ + v to paste images

What steps can reproduce the bug?

  1. Run Codex from source under WSL2.
  2. Run the TUI unit tests:
  • cargo test -p codex-tui
  • cargo test -p codex-tui2
  1. Observe snapshot failures in footer/shortcut overlay tests.

What is the expected behavior?

Snapshot tests should be deterministic across environments. WSL-specific runtime behavior is fine, but unit test snapshots should not depend on host detection.

Additional information

A fix is proposed in PR #9359: gate WSL detection behind cfg(not(test)) (runtime unchanged) and add a focused unit test that still asserts the WSL-specific paste-image binding.

View original on GitHub ↗