fix: hide process window when sourcing shell env (#3577)

Fixes #3571
This commit is contained in:
Jakub Panek 2024-10-24 11:36:18 +02:00 committed by GitHub
parent ef22ae0c6d
commit 6ef86351fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -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(),