diff --git a/src/PowerShellEditorServices.Protocol/Server/DebugAdapter.cs b/src/PowerShellEditorServices.Protocol/Server/DebugAdapter.cs index dcd346e93..86a87cc9b 100644 --- a/src/PowerShellEditorServices.Protocol/Server/DebugAdapter.cs +++ b/src/PowerShellEditorServices.Protocol/Server/DebugAdapter.cs @@ -79,7 +79,10 @@ protected Task LaunchScript(RequestContext requestContext) .ExecuteScriptAtPath(this.scriptPathToLaunch, this.arguments) .ContinueWith( async (t) => { - Logger.Write(LogLevel.Verbose, "Execution completed, terminating..."); + Logger.Write(LogLevel.Verbose, "Execution completed, flushing output then terminating..."); + + // Make sure remaining output is flushed before exiting + await this.outputDebouncer.Flush(); await requestContext.SendEvent( TerminatedEvent.Type,