From 61d8d6fa771db4a712667a545c6a5917b8156599 Mon Sep 17 00:00:00 2001 From: JoeAllen <2494136784@qq.com> Date: Tue, 13 Oct 2026 00:31:35 +0800 Subject: [PATCH] =?UTF-8?q?fix(windows):=20=E5=8F=91=E5=B8=83=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E4=B8=8D=E5=86=8D=E5=BC=B9=E5=87=BA=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E5=8F=B0=E7=AA=97=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Windows 上入口默认 console 子系统,运行时自动创建控制台窗口。 按 debug_assertions 分流:release 用 windows 子系统(纯 GUI,无 控制台;eprintln/tracing 输出丢弃),debug 保留 console 子系统 (日志直接可见)。程序化验证:release 无 ConsoleWindowClass 窗口,debug 保留控制台连接。 --- gpui-app/src/main.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gpui-app/src/main.rs b/gpui-app/src/main.rs index f7af500..9730c37 100644 --- a/gpui-app/src/main.rs +++ b/gpui-app/src/main.rs @@ -1,3 +1,7 @@ +// 发布构建不创建控制台窗口(GUI 子系统);debug 构建保留控制台, +// 便于直接查看 eprintln / tracing 日志输出。 +#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] + use gpui_kit::component::TitleBar; use gpui_kit::*;