Skip to content
This repository was archived by the owner on May 5, 2026. It is now read-only.
This repository was archived by the owner on May 5, 2026. It is now read-only.

Cross-platform: enable_mouse_capture test fails on Windows (crossterm Win32 API) #37

Description

@noahgift

Bug

Cross-platform CI fails on Windows: app::tests::test_testable_backend_enable_mouse_capture assertion fails at app_tests.rs:1200.

3203 tests pass, 1 fails. This has failed on every Windows run (30+ consecutive).

Five-Whys Root Cause

  1. Why does the test fail? output Vec is empty after enable_mouse_capture()
  2. Why no bytes written? crossterm's EnableMouseCapture on Windows uses Windows Console API, not ANSI escape sequences
  3. Why Console API? crossterm dispatches to SetConsoleMode on Windows targets — no bytes written to Write impl
  4. Why does test assume ANSI output? Written with Unix behavior in mind where execute! writes \x1b[?1000h
  5. Why not caught earlier? Main CI runs on Linux (sovereign-ci container); cross-platform workflow added later

Root Cause

crossterm's EnableMouseCapture uses Windows Console API (Win32 SetConsoleMode) instead of writing ANSI escape sequences to the writer on Windows. The test asserts bytes were written, which is only true on Unix.

Fix

Guard the assertion with #[cfg(not(target_os = "windows"))] or remove it entirely — the is_mouse_captured() assertion already verifies correctness.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions