Skip to content

Commit

Permalink
Merge branch 'master' of github.com:BetterThanTomorrow/calva
Browse files Browse the repository at this point in the history
  • Loading branch information
PEZ committed Jun 13, 2019
2 parents 57c6c8a + fee64a3 commit 98918ce
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion calva/nrepl/jack-in.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ export async function calvaJackIn() {
// Now look in our $PATH variable to check the appropriate command exists.
const cmd = isWin ? projectType.winCmd : projectType.cmd;
let executable = findInPath(cmd);
let integrated_shell = "";

if (!executable) {
// It doesn't, do not proceed
Expand All @@ -286,6 +287,10 @@ export async function calvaJackIn() {
args = args.map(escapeString) as Array<string>;
args.unshift(executable);
executable = "powershell.exe";
} else if (executable.endsWith(".bat")) {
// Current workaround for the not working powershell etc. changes to cmd.exe and later back to whaterver was set before
integrated_shell = vscode.workspace.getConfiguration("terminal.integrated.shell").get("windows");
await vscode.workspace.getConfiguration().update("terminal.integrated.shell.windows", "C:\\Windows\\System32\\cmd.exe");
}

state.cursor.set("launching", projectTypeSelection)
Expand All @@ -307,12 +312,18 @@ export async function calvaJackIn() {
const task = new vscode.Task(taskDefinition, folder, TASK_NAME, "Calva", execution);

state.analytics().logEvent("REPL", "JackInExecuting", JSON.stringify(cljTypes)).send();

vscode.tasks.executeTask(task).then(
(v) => {
},
(reason) => {
watcher.close()
outputChannel.appendLine("Error in Jack-in: " + reason);
});

setTimeout(() => {
if (executable.endsWith(".bat")) {
vscode.workspace.getConfiguration().update("terminal.integrated.shell.windows", integrated_shell);
}
integrated_shell = undefined;
}, 1000);
}

0 comments on commit 98918ce

Please sign in to comment.