From 6dffb2e35788e0814ef074e35df746d644b3603b Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Tue, 8 Feb 2022 13:51:21 +0100 Subject: [PATCH] Fix shellExecutable basename for tasks Part of #142196 --- src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts b/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts index 1a6926f25e962..3135535e4ae73 100644 --- a/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts +++ b/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts @@ -1443,9 +1443,9 @@ export class TerminalTaskSystem extends Disposable implements ITaskSystem { let commandLine = result.join(' '); // There are special rules quoted command line in cmd.exe if (platform === Platform.Platform.Windows) { - if (shellExecutable === 'cmd' && commandQuoted && argQuoted) { + if (basename === 'cmd' && commandQuoted && argQuoted) { commandLine = '"' + commandLine + '"'; - } else if ((shellExecutable === 'powershell' || shellExecutable === 'pwsh') && commandQuoted) { + } else if ((basename === 'powershell' || basename === 'pwsh') && commandQuoted) { commandLine = '& ' + commandLine; } }