Skip to content

Commit 99e5ab9

Browse files
committed
Only use shell to spawn commands when on Windows
1 parent 63f8182 commit 99e5ab9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/languageSetup.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as path from "path";
55
import * as vscode from 'vscode';
66
import { LanguageClient, LanguageClientOptions, RevealOutputChannelOn, ServerOptions, StreamInfo } from "vscode-languageclient/node";
77
import { LOG } from './util/logger';
8-
import { isOSUnixoid, correctScriptName } from './util/osUtils';
8+
import { isOSUnixoid, correctScriptName, isOSWindows } from './util/osUtils';
99
import { ServerDownloader } from './serverDownloader';
1010
import { JarClassContentProvider } from "./jarClassContentProvider";
1111
import { KotlinApi } from "./lspExtensions";
@@ -222,7 +222,7 @@ function createLanguageClient(options: {
222222
command: options.startScriptPath,
223223
args: [],
224224
options: {
225-
shell: true,
225+
shell: isOSWindows(),
226226
cwd: vscode.workspace.workspaceFolders?.[0]?.uri?.fsPath,
227227
env: options.env
228228
} // TODO: Support multi-root workspaces (and improve support for when no available is available)
@@ -248,7 +248,7 @@ export function spawnLanguageServerProcessAndConnectViaTcp(options: {
248248
// Wait for the first client to connect
249249
server.listen(options.tcpPort, () => {
250250
const tcpPort = (server.address() as net.AddressInfo).port.toString();
251-
const proc = child_process.spawn(options.startScriptPath, ["--tcpClientPort", tcpPort], { shell: true });
251+
const proc = child_process.spawn(options.startScriptPath, ["--tcpClientPort", tcpPort], { shell: isOSWindows() });
252252
LOG.info("Creating client at {} via TCP port {}", options.startScriptPath, tcpPort);
253253

254254
const outputCallback = data => options.outputChannel.append(`${data}`);

0 commit comments

Comments
 (0)