File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -9,13 +9,22 @@ function startREPLCommand(context: vscode.ExtensionContext) {
9
9
}
10
10
11
11
async function startREPL ( preserveFocus : boolean ) {
12
+ console . log ( "function startREPL called..." ) ;
12
13
if ( g_terminal === undefined ) {
13
14
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 } ` ) ;
14
22
g_terminal = vscode . window . createTerminal ( {
15
23
name : "macaulay2" ,
16
24
shellPath : exepath ,
17
25
shellArgs : [ ] ,
18
- env : { }
26
+ env : { } ,
27
+ cwd : `${ dirpath } `
19
28
} ) ;
20
29
}
21
30
g_terminal . show ( preserveFocus ) ;
You can’t perform that action at this time.
0 commit comments