Skip to content

Commit 940ca43

Browse files
committed
Correctly skip next prompt when interrupting foreground task
I believe this was the original intention, and indeed, debugging shows that it is the correct behavior. On F8 we need to skip the next prompt so the evaluated task runs instead, and then the REPL correctly prompts after the evaluation is finished.
1 parent 72a24e6 commit 940ca43

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/PowerShellEditorServices/Services/PowerShell/Host/PsesInternalHost.cs

+2
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,13 @@ public Task<T> InvokeTaskOnPipelineThreadAsync<T>(
270270
// - block the consumer thread from mutating the queue
271271
// - cancel any running task on the consumer thread
272272
// - place our task on the front of the queue
273+
// - skip the next prompt so the task runs instead
273274
// - unblock the consumer thread
274275
using (_taskQueue.BlockConsumers())
275276
{
276277
CancelCurrentTask();
277278
_taskQueue.Prepend(task);
279+
_skipNextPrompt = true;
278280
}
279281

280282
return task.Task;

0 commit comments

Comments
 (0)