diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c97a7386..c61c0fe4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Changes to Calva. ## [Unreleased] - Update cider-nrepl to [0.26.0](https://github.com/clojure-emacs/cider-nrepl/releases/tag/v0.26.0) +- Fix [Getting Started Repl not working on some Windows machines](https://github.com/BetterThanTomorrow/calva/issues/1162) ## [2.0.194] - 2021-04-26 - [Make Clojure-lsp Server Info command always enabled](https://github.com/BetterThanTomorrow/calva/issues/1143) diff --git a/src/nrepl/project-types.ts b/src/nrepl/project-types.ts index 9e98c92e9..c89f98f82 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) => { @@ -448,8 +448,8 @@ async function cljCommandLine(connectSequence: ReplConnectSequence, cljsType: Cl }; const useMiddleware = [...middleware, ...(cljsType ? cljsMiddleware[cljsType] : [])]; const aliasesOption = aliases.length > 0 ? `-A${aliases.join("")}` : ''; - const q = isWin ? '"' : "'"; - const dQ = isWin ? '""' : '"'; + const q = isWin ? '' : "'"; + const dQ = '"'; for (let dep in dependencies) out.push(dep + ` {:mvn/version,${dQ}${dependencies[dep]}${dQ}}`) @@ -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;