From 6a76304318173aa09647e7d3f176632142641283 Mon Sep 17 00:00:00 2001 From: Mucheen <1528136628@qq.com> Date: Mon, 17 Aug 2026 20:27:02 +0800 Subject: [PATCH 1/2] Prevent Windows background console flashes Apply CREATE_NO_WINDOW to language-server launches and registry font queries so IDE background work cannot create visible console windows. Add focused Windows regression coverage while leaving explicit ConPTY terminals unchanged. --- rust/lithe-core/src/lsp/interface/process.rs | 26 ++++++++++++++++++++ windows/tauri/src-tauri/src/host.rs | 20 +++++++++++++-- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/rust/lithe-core/src/lsp/interface/process.rs b/rust/lithe-core/src/lsp/interface/process.rs index 2f59aa1d..ac5f4df7 100644 --- a/rust/lithe-core/src/lsp/interface/process.rs +++ b/rust/lithe-core/src/lsp/interface/process.rs @@ -13,6 +13,9 @@ use std::path::PathBuf; use std::process::{Child, ChildStdin, Command, Stdio}; use std::sync::{Arc, Mutex}; +#[cfg(target_os = "windows")] +use std::os::windows::process::CommandExt; + /// Everything needed to start a language server, after provider adaptation has /// already rewritten the arguments. pub struct LspProcessSpec { @@ -75,6 +78,7 @@ impl LspProcessLauncher for SystemProcessLauncher { .stdin(Stdio::piped()) .stdout(Stdio::piped()) .stderr(Stdio::piped()); + apply_language_server_creation_flags(&mut command); let mut child = command.spawn().map_err(|error| { CoreError::new( ErrorCode::ProcessStartFailed, @@ -102,6 +106,20 @@ impl LspProcessLauncher for SystemProcessLauncher { } } +fn apply_language_server_creation_flags(command: &mut Command) { + #[cfg(target_os = "windows")] + command.creation_flags(language_server_process_creation_flags()); + + #[cfg(not(target_os = "windows"))] + let _ = command; +} + +#[cfg(target_os = "windows")] +fn language_server_process_creation_flags() -> u32 { + const CREATE_NO_WINDOW: u32 = 0x0800_0000; + CREATE_NO_WINDOW +} + struct SystemProcess { input: Mutex>, child: Mutex, @@ -166,3 +184,11 @@ fn missing_stream(stream: &str) -> CoreError { ) .with_details(stream) } + +#[cfg(all(test, target_os = "windows"))] +mod tests { + #[test] + fn background_language_servers_do_not_create_windows_console() { + assert_eq!(super::language_server_process_creation_flags(), 0x0800_0000); + } +} diff --git a/windows/tauri/src-tauri/src/host.rs b/windows/tauri/src-tauri/src/host.rs index 78256f69..62da2f7b 100644 --- a/windows/tauri/src-tauri/src/host.rs +++ b/windows/tauri/src-tauri/src/host.rs @@ -371,6 +371,12 @@ mod tests { assert!(widths.contains(&32), "{widths:?}"); assert!(widths.contains(&256), "{widths:?}"); } + + #[cfg(target_os = "windows")] + #[test] + fn background_font_queries_do_not_create_windows_console() { + assert_eq!(super::font_query_process_creation_flags(), 0x0800_0000); + } } #[tauri::command] @@ -431,13 +437,17 @@ pub fn validate_font(font_family: String) -> bool { #[cfg(target_os = "windows")] fn platform_fonts() -> Vec { + use std::os::windows::process::CommandExt; use std::process::Command; - let output = Command::new("reg.exe") + + let mut command = Command::new("reg.exe"); + command .args([ "query", r"HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts", ]) - .output(); + .creation_flags(font_query_process_creation_flags()); + let output = command.output(); let text = output .ok() .filter(|value| value.status.success()) @@ -468,6 +478,12 @@ fn platform_fonts() -> Vec { .collect() } +#[cfg(target_os = "windows")] +fn font_query_process_creation_flags() -> u32 { + const CREATE_NO_WINDOW: u32 = 0x0800_0000; + CREATE_NO_WINDOW +} + #[cfg(not(target_os = "windows"))] fn platform_fonts() -> Vec { [ From 3ef1b36e499529a00c4930bb0d948577f1047497 Mon Sep 17 00:00:00 2001 From: Mucheen <1528136628@qq.com> Date: Mon, 17 Aug 2026 21:07:34 +0800 Subject: [PATCH 2/2] fix(windows): align project tab close button --- .../window/components/project-tab-bar.test.ts | 4 +++ .../window/components/project-tab-bar.tsx | 31 ++++++++++--------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/windows/tauri/src/features/window/components/project-tab-bar.test.ts b/windows/tauri/src/features/window/components/project-tab-bar.test.ts index 8903c0d2..4e7bd08a 100644 --- a/windows/tauri/src/features/window/components/project-tab-bar.test.ts +++ b/windows/tauri/src/features/window/components/project-tab-bar.test.ts @@ -17,4 +17,8 @@ test("project tab bar exposes accessible switchable and closable project tabs", expect(source).toContain('t("titleProject.closeProject", { name: project.name })'); expect(source).toContain("group-hover:opacity-100"); expect(source).toContain("group-focus-within:opacity-100"); + expect(source).toContain( + "absolute inset-y-0 right-1 z-10 flex items-center transition-opacity", + ); + expect(source).not.toContain("-translate-y-1/2"); }); diff --git a/windows/tauri/src/features/window/components/project-tab-bar.tsx b/windows/tauri/src/features/window/components/project-tab-bar.tsx index 4ee4d426..19d7bb6f 100644 --- a/windows/tauri/src/features/window/components/project-tab-bar.tsx +++ b/windows/tauri/src/features/window/components/project-tab-bar.tsx @@ -75,26 +75,29 @@ export function ProjectTabBar() { /> ) : null} - + + ); })}