@@ -26,14 +26,15 @@ public class DebugAdapter : DebugAdapterBase
26
26
private OutputDebouncer outputDebouncer ;
27
27
28
28
private bool noDebug ;
29
+ private string arguments ;
29
30
private bool isRemoteAttach ;
30
31
private bool isAttachSession ;
31
32
private bool waitingForAttach ;
32
33
private string scriptToLaunch ;
33
34
private bool enableConsoleRepl ;
34
35
private bool ownsEditorSession ;
35
36
private bool executionCompleted ;
36
- private string arguments ;
37
+ private bool isInteractiveDebugSession ;
37
38
private RequestContext < object > disconnectRequestContext = null ;
38
39
39
40
public DebugAdapter ( HostDetails hostDetails , ProfilePaths profilePaths )
@@ -303,13 +304,9 @@ protected async Task HandleLaunchRequest(
303
304
304
305
await requestContext . SendResult ( null ) ;
305
306
306
- // If no script is being launched, execute an empty script to
307
- // cause the prompt string to be evaluated and displayed
308
- if ( string . IsNullOrEmpty ( this . scriptToLaunch ) )
309
- {
310
- await this . editorSession . PowerShellContext . ExecuteScriptString (
311
- "" , false , true ) ;
312
- }
307
+ // If no script is being launched, mark this as an interactive
308
+ // debugging session
309
+ this . isInteractiveDebugSession = string . IsNullOrEmpty ( this . scriptToLaunch ) ;
313
310
314
311
if ( this . editorSession . ConsoleService . EnableConsoleRepl )
315
312
{
@@ -447,6 +444,11 @@ protected async Task HandleDisconnectRequest(
447
444
{
448
445
this . disconnectRequestContext = requestContext ;
449
446
this . editorSession . PowerShellContext . AbortExecution ( ) ;
447
+
448
+ if ( this . isInteractiveDebugSession )
449
+ {
450
+ await this . OnExecutionCompleted ( null ) ;
451
+ }
450
452
}
451
453
else
452
454
{
0 commit comments