Change:
See The change that caused this was a standalone fix for a relatively minor bug, so I will back it out for now.
I'm able to debug a JS file on macOS now with nvm and a launch configuration that contains .
Just a FYI - I don't use nvm but experienced this issue. The recent update fixed it for me, thanks!!

Discussion:
import type * as vscode from 'vscode'; import { ExtHostConfigProvider, IExtHostConfiguration } from '../common/extHostConfiguration'; import { IExtHostCommands } from 'vs/workbench/api/common/extHostCommands'; <del> import { createHash } from 'crypto'; </del> export class ExtHostDebugService extends ExtHostDebugServiceBase {

const terminalName = args.title || nls.localize('debug.terminal.title', "Debug Process"); <del> const termKey = createKeyForShell(shell, shellArgs, args); let terminal = await this._integratedTerminalInstances.checkout(termKey, terminalName, true); </del> <ins> const shellConfig = JSON.stringify({ shell, shellArgs }); let terminal = await this._integratedTerminalInstances.checkout(shellConfig, terminalName); </ins> let cwdForPrepareCommand: string | undefined; let giveShellTimeToInitialize = false;

cwd: args.cwd, name: terminalName, iconPath: new ThemeIcon('debug'), <del> env: args.env, </del> }; giveShellTimeToInitialize = true; terminal = this._terminalService.createTerminalFromOptions(options, {

forceShellIntegration: true, useShellEnvironment: true }); <del> this._integratedTerminalInstances.insert(terminal, termKey); </del> <ins> this._integratedTerminalInstances.insert(terminal, shellConfig); </ins> } else { cwdForPrepareCommand = args.cwd;

} } <del> const command = prepareCommand(shell, args.args, !!args.argsCanBeInterpretedByShell, cwdForPrepareCommand); </del> <ins> const command = prepareCommand(shell, args.args, !!args.argsCanBeInterpretedByShell, cwdForPrepareCommand, args.env); </ins> terminal.sendText(command); // Mark terminal as unused when its session ends, see #112055

} } <del> /** Creates a key that determines how terminals get reused */ function createKeyForShell(shell: string, shellArgs: string | string[], args: DebugProtocol.RunInTerminalRequestArguments) { const hash = createHash('sha256'); hash.update(JSON.stringify({ shell, shellArgs })); hash.update(JSON.stringify(Object.entries(args.env || {}).sort(([k1], [k2]) => k1.localeCompare(k2)))); return hash.digest('base64'); } </del> let externalTerminalService: IExternalTerminalService | undefined = undefined; function runInExternalTerminal(args: DebugProtocol.RunInTerminalRequestArguments, configProvider: ExtHostConfigProvider): Promise<number | undefined> {

const enum ShellType { cmd, powershell, bash } <del> export function prepareCommand(shell: string, args: string[], argsCanBeInterpretedByShell: boolean, cwd?: string): string { </del> <ins> export function prepareCommand(shell: string, args: string[], argsCanBeInterpretedByShell: boolean, cwd?: string, env?: { [key: string]: string | null }): string { </ins> shell = shell.trim().toLowerCase();

} command += `cd ${quote(cwd)}; `; } <ins> if (env) { for (const key in env) { const value = env[key]; if (value === null) { command += `Remove-Item env:${key}; `; } else { command += `${env:${key}}='${value}'; `; } } } </ins> if (args.length > 0) { const arg = args.shift()!; const cmd = argsCanBeInterpretedByShell ? arg : quote(arg);

} command += `cd ${quote(cwd)} && `; } <ins> if (env) { command += 'cmd /C "'; for (const key in env) { let value = env[key]; if (value === null) { command += `set "${key}=" && `; } else { value = value.replace(/[&^|<>]/g, s => `^${s}`); command += `set "${key}=${value}" && `; } } } </ins> for (const a of args) { command += (a === '<' || a === '>' || argsCanBeInterpretedByShell) ? a : quote(a); command += ' '; } <ins> if (env) { command += '"'; } </ins> break; case ShellType.bash: {

return s.length === 0 ? `""` : s; }; <ins> const hardQuote = (s: string) => { return /[^w@%/+=,.:^-]/.test(s) ? `'${s.replace(/'/g, ''''')}'` : s; }; </ins> if (cwd) { command += `cd ${quote(cwd)} ; `; } <ins> if (env) { command += '/usr/bin/env'; for (const key in env) { const value = env[key]; if (value === null) { command += ` -u ${hardQuote(key)}`; } else { command += ` ${hardQuote(`${key}=${value}`)}`; } } command += ' '; } </ins> for (const a of args) { command += (a === '<' || a === '>' || argsCanBeInterpretedByShell) ? a : quote(a); command += ' ';