Skip to content

WSL: shortcut overlay snapshot tests are non-deterministic #9361

@slkzgm

Description

@slkzgm

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
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displaybugSomething isn't workingwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions