From d41ab7290e8529ed1bd540f96ab89be72ca7378f Mon Sep 17 00:00:00 2001 From: David Wiesen Date: Mon, 6 Oct 2025 11:43:15 -0700 Subject: [PATCH] fix handle type. --- codex-rs/tui/src/terminal_palette.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/codex-rs/tui/src/terminal_palette.rs b/codex-rs/tui/src/terminal_palette.rs index 7550ee0f99..fcd5398231 100644 --- a/codex-rs/tui/src/terminal_palette.rs +++ b/codex-rs/tui/src/terminal_palette.rs @@ -596,7 +596,9 @@ mod imp { fn query_console_snapshot() -> Option { unsafe { let handle = GetStdHandle(STD_OUTPUT_HANDLE); - if handle.is_null() || handle == INVALID_HANDLE_VALUE { + // `HANDLE` is an `isize`, so compare against 0 explicitly instead of treating + // it like a raw pointer when verifying the console handle succeeded. + if handle == 0 || handle == INVALID_HANDLE_VALUE { return None; }