From 4aca03f56dc459c70b7530348bb50bbc6465eb39 Mon Sep 17 00:00:00 2001 From: Andy Jordan Date: Mon, 8 Aug 2022 14:11:12 -0700 Subject: [PATCH] Always base64 encode the startup command to avoid quoting issues We already did this for non-Windows and it works great to avoid issues with quoting the server startup command. Let's do it on Windows too because some installations of PowerShell (specifically through the `dotnet` global tool) also have quote issues that became apparent with a multi-line startup banner. --- src/process.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/process.ts b/src/process.ts index 4898e8b836..498567492a 100644 --- a/src/process.ts +++ b/src/process.ts @@ -83,16 +83,10 @@ export class PowerShellProcess { PowerShellProcess.escapeSingleQuotes(psesModulePath) + "'; Start-EditorServices " + this.startPsesArgs; - if (utils.isWindows) { - powerShellArgs.push( - "-Command", - startEditorServices); - } else { - // Use -EncodedCommand for better quote support on non-Windows - powerShellArgs.push( - "-EncodedCommand", - Buffer.from(startEditorServices, "utf16le").toString("base64")); - } + // Use -EncodedCommand to avoid quoting issues + powerShellArgs.push( + "-EncodedCommand", + Buffer.from(startEditorServices, "utf16le").toString("base64")); this.log.write( "Language server starting --",