From 6ef86351fc9574fe739ddb73ec1940ec2b479c54 Mon Sep 17 00:00:00 2001 From: Jakub Panek Date: Thu, 24 Oct 2024 11:36:18 +0200 Subject: [PATCH] fix: hide process window when sourcing shell env (#3577) Fixes #3571 --- lapce-app/src/app.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lapce-app/src/app.rs b/lapce-app/src/app.rs index 2a7ea555..d1562ff8 100644 --- a/lapce-app/src/app.rs +++ b/lapce-app/src/app.rs @@ -3704,7 +3704,7 @@ pub fn launch() { args.push("--wait".to_string()); let mut cmd = std::process::Command::new(&args[0]); #[cfg(target_os = "windows")] - cmd.creation_flags(0x08000000); // CREATE_NO_WINDOW + cmd.creation_flags(windows::Win32::System::Threading::CREATE_NO_WINDOW); let stderr_file_path = Directory::logs_directory().unwrap().join("stderr.log"); @@ -4002,6 +4002,9 @@ pub fn load_shell_env() { "Get-ChildItem env: | ForEach-Object { \"{0}={1}\" -f $_.Name, $_.Value }", ]); + #[cfg(windows)] + command.creation_flags(windows::Win32::System::Threading::CREATE_NO_WINDOW); + let env = match command.output() { Ok(output) => String::from_utf8(output.stdout).unwrap_or_default(),