Skip to content

Commit 295c901

Browse files
committed
Fix issue with debugger output not being written for short scripts
This change fixes an issue where script output for very small scripts is not being written out reliably before the debug adapter terminates. The fix is to add an extra output flush before sending the TerminatedEvent back to the client. This fix is temporary until we get the REPL integration online. Resolves #138. Resolves PowerShell/vscode-powershell#284.
1 parent e70d3b2 commit 295c901

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/PowerShellEditorServices.Protocol/Server/DebugAdapter.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@ protected Task LaunchScript(RequestContext<object> requestContext)
7979
.ExecuteScriptAtPath(this.scriptPathToLaunch, this.arguments)
8080
.ContinueWith(
8181
async (t) => {
82-
Logger.Write(LogLevel.Verbose, "Execution completed, terminating...");
82+
Logger.Write(LogLevel.Verbose, "Execution completed, flushing output then terminating...");
83+
84+
// Make sure remaining output is flushed before exiting
85+
await this.outputDebouncer.Flush();
8386

8487
await requestContext.SendEvent(
8588
TerminatedEvent.Type,

0 commit comments

Comments
 (0)