windows: Set CREATE_NO_WINDOW for commands (#18447)

- Closes: #18371

Release Notes:

- N/A
This commit is contained in:
张小白 2024-11-21 08:52:38 +08:00 committed by GitHub
parent 49ed932c1f
commit 95ace03706
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
31 changed files with 122 additions and 174 deletions

View file

@ -611,12 +611,7 @@ impl LocalLspStore {
Some(worktree_path)
})?;
let mut child = smol::process::Command::new(command);
#[cfg(target_os = "windows")]
{
use smol::process::windows::CommandExt;
child.creation_flags(windows::Win32::System::Threading::CREATE_NO_WINDOW.0);
}
let mut child = util::command::new_smol_command(command);
if let Some(buffer_env) = buffer.env.as_ref() {
child.envs(buffer_env);
@ -7935,7 +7930,7 @@ impl LspAdapterDelegate for LocalLspAdapterDelegate {
};
let env = self.shell_env().await;
let output = smol::process::Command::new(&npm)
let output = util::command::new_smol_command(&npm)
.args(["root", "-g"])
.envs(env)
.current_dir(local_package_directory)
@ -7969,7 +7964,7 @@ impl LspAdapterDelegate for LocalLspAdapterDelegate {
async fn try_exec(&self, command: LanguageServerBinary) -> Result<()> {
let working_dir = self.worktree_root_path();
let output = smol::process::Command::new(&command.path)
let output = util::command::new_smol_command(&command.path)
.args(command.arguments)
.envs(command.env.clone().unwrap_or_default())
.current_dir(working_dir)