Skip to content

Commit 17b3895

Browse files
committed
REPL should start in cwd
1 parent a977cc1 commit 17b3895

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/repl.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,22 @@ function startREPLCommand(context: vscode.ExtensionContext) {
99
}
1010

1111
async function startREPL(preserveFocus: boolean) {
12+
console.log("function startREPL called...");
1213
if (g_terminal === undefined) {
1314
let exepath = vscode.workspace.getConfiguration("macaulay2").get<string>("executablePath");
15+
// console.log(`Starting REPL in ${fileDirname} based on current file of ${file}`);
16+
let editor = vscode.window.activeTextEditor;
17+
let fullpath = editor!.document.uri.path;
18+
let dirarray = fullpath.split("/");
19+
dirarray.pop();
20+
let dirpath = dirarray.join("/");
21+
console.log(`dirpath: ${dirpath}`);
1422
g_terminal = vscode.window.createTerminal({
1523
name: "macaulay2",
1624
shellPath: exepath,
1725
shellArgs: [],
18-
env: {}
26+
env: {},
27+
cwd: `${dirpath}`
1928
});
2029
}
2130
g_terminal.show(preserveFocus);

0 commit comments

Comments
 (0)