mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-20 02:08:47 +00:00
cli: fix windows service-mode not working (#187883)
It seems like we need to run the server (a batch file) with cmd explicitly when the server itself is not run from a command prompt.
This commit is contained in:
@@ -566,7 +566,17 @@ impl<'a> ServerBuilder<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn get_base_command(&self) -> Command {
|
fn get_base_command(&self) -> Command {
|
||||||
|
#[cfg(not(windows))]
|
||||||
let mut cmd = Command::new(&self.server_paths.executable);
|
let mut cmd = Command::new(&self.server_paths.executable);
|
||||||
|
#[cfg(windows)]
|
||||||
|
let mut cmd = {
|
||||||
|
let mut cmd = Command::new("cmd");
|
||||||
|
cmd.arg("/Q");
|
||||||
|
cmd.arg("/C");
|
||||||
|
cmd.arg(&self.server_paths.executable);
|
||||||
|
cmd
|
||||||
|
};
|
||||||
|
|
||||||
cmd.stdin(std::process::Stdio::null())
|
cmd.stdin(std::process::Stdio::null())
|
||||||
.args(self.server_params.code_server_args.command_arguments());
|
.args(self.server_params.code_server_args.command_arguments());
|
||||||
cmd
|
cmd
|
||||||
|
|||||||
Reference in New Issue
Block a user