Skip to content

Commit 5a110b4

Browse files
rkeithhilldaviwil
authored andcommitted
Better fix for the untitled working dir situation
1 parent 2d19bf3 commit 5a110b4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/PowerShellEditorServices.Protocol/Server/DebugAdapter.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,9 @@ protected async Task HandleLaunchRequest(
253253
launchParams.Program;
254254
#pragma warning restore 618
255255

256-
// We come through here first when debugging an untitled (unsaved) file - there is now working dir.
257-
if (workingDir.StartsWith("untitled:"))
256+
// When debugging an "untitled" (unsaved) file - the working dir can't be derived
257+
// from the Script path. OTOH, if the launch params specifies a Cwd, use it.
258+
if (workingDir.StartsWith("untitled:") && string.IsNullOrEmpty(launchParams.Cwd))
258259
{
259260
workingDir = null;
260261
}

0 commit comments

Comments
 (0)