From 244d8517f1be625d1ebcccf067906e2d8a840aac Mon Sep 17 00:00:00 2001 From: InfyniteHeap Date: Thu, 5 Jun 2025 19:38:19 +0800 Subject: [PATCH] Fix Unexpected Console Window When Running Zed Release Build (#32144) The commit #31073 had introduced `zed-main.rs`, which replaced the previous `main.rs` to be the "true" entry of the whole program. But as the macro `#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]` only works in the "true" entry, the release build will also arise the console window if this macro doesn't move to the new entry (the `zed-main.rs` here). Release Notes: - N/A --- crates/zed/src/main.rs | 3 --- crates/zed/src/zed-main.rs | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/zed/src/main.rs b/crates/zed/src/main.rs index 532963fadf..490f5b8d67 100644 --- a/crates/zed/src/main.rs +++ b/crates/zed/src/main.rs @@ -1,6 +1,3 @@ -// Disable command line from opening on release mode -#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] - mod reliability; mod zed; diff --git a/crates/zed/src/zed-main.rs b/crates/zed/src/zed-main.rs index 051d02802e..6c49c197dd 100644 --- a/crates/zed/src/zed-main.rs +++ b/crates/zed/src/zed-main.rs @@ -1,3 +1,6 @@ +// Disable command line from opening on release mode +#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] + pub fn main() { // separated out so that the file containing the main function can be imported by other crates, // while having all gpui resources that are registered in main (primarily actions) initialized