diff --git a/src/nrepl/jack-in.ts b/src/nrepl/jack-in.ts index 3ccba0583..b6327446c 100644 --- a/src/nrepl/jack-in.ts +++ b/src/nrepl/jack-in.ts @@ -162,6 +162,13 @@ async function getJackInTerminalOptions(projectConnectSequence: ReplConnectSeque } executable = cmd[0]; args = [...cmd.slice(1), ...args]; + if (projectTypes.isWin && projectType.resolveBundledPathWin) { + const cmdFile = path.join('.calva', 'start.cmd'); + const cmdFileUri = vscode.Uri.file(path.join(state.getProjectRootLocal(), '.calva', 'start.cmd')) + utilities.writeTextToFile(cmdFileUri, createCommandLine(executable, args)) + executable = cmdFile; + args = []; + } const terminalOptions: JackInTerminalOptions = { name: `Calva Jack-in: ${projectConnectSequence.name}`, diff --git a/src/nrepl/project-types.ts b/src/nrepl/project-types.ts index 9e98c92e9..abbfc7455 100644 --- a/src/nrepl/project-types.ts +++ b/src/nrepl/project-types.ts @@ -251,7 +251,7 @@ const cljsMiddleware: { [id: string]: string[] } = { const serverPrinterDependencies = pprint.getServerSidePrinterDependencies(); function depsCljWindowsPath() { - return `"${path.join('.', '.calva', 'deps.clj.jar')}"`; + return `${path.join('.', '.calva', 'deps.clj.jar')}`; } const projectTypes: { [id: string]: ProjectType } = { @@ -368,7 +368,7 @@ const projectTypes: { [id: string]: ProjectType } = { resolveBundledPathWin: depsCljWindowsPath, resolveBundledPathUnix: () => `'${path.join(state.extensionContext.extensionPath, 'deps.clj.jar')}'`, processShellUnix: true, - processShellWin: true, + processShellWin: false, useWhenExists: undefined, nReplPortFile: [".nrepl-port"], commandLine: async (connectSequence: ReplConnectSequence, cljsType: CljsTypes) => { @@ -458,7 +458,7 @@ async function cljCommandLine(connectSequence: ReplConnectSequence, cljsType: Cl if (selectedAliasesHasMain) { args.push(aliasesOption); } else { - args.push(aliasesOption, "-m", "nrepl.cmdline", "--middleware", `"[${useMiddleware.join(' ')}]"`); + args.push(aliasesOption, "-m", "nrepl.cmdline", "--middleware", `${q}[${useMiddleware.join(' ')}]${q}`); } return args;