File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ export class DebugSessionFeature implements IFeature {
4242
4343 if ( config . request === 'launch' ) {
4444 // Make sure there's a usable working directory if possible
45- config . cwd = config . cwd || vscode . workspace . rootPath || config . script ;
45+ config . cwd = config . cwd || vscode . workspace . rootPath ;
4646
4747 // For launch of "current script", don't start the debugger if the current file
4848 // is not a file that can be debugged by PowerShell
@@ -80,6 +80,12 @@ export class DebugSessionFeature implements IFeature {
8080 }
8181 }
8282 }
83+ else if ( config . script ) {
84+ // In this case, the user has explicitly defined a script path
85+ // so make sure to set the cwd to that path if the cwd wasn't
86+ // explicitly set
87+ config . cwd = config . cwd || config . script ;
88+ }
8389 }
8490
8591 // Prevent the Debug Console from opening
You can’t perform that action at this time.
0 commit comments