Skip to content

Commit c242a1f

Browse files
committed
Interrupt command prompt when a Plaster template is invoked
This change fixes an issue where invoking a Plaster template from within VS Code causes Plaster prompts to be handled incorrectly because the command prompt has not been interrupted. The fix is to request that the command prompt be interrupted when Invoke-Plaster is called. Fixes PowerShell/vscode-powershell#643.
1 parent 26f6ada commit c242a1f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Diff for: src/PowerShellEditorServices/Templates/TemplateService.cs

+8-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,14 @@ public async Task<bool> CreateFromTemplate(
174174

175175
var errorString = new System.Text.StringBuilder();
176176
await this.powerShellContext.ExecuteCommand<PSObject>(
177-
command, errorString, false, true);
177+
command,
178+
errorString,
179+
new ExecutionOptions
180+
{
181+
WriteOutputToHost = false,
182+
WriteErrorsToHost = true,
183+
InterruptCommandPrompt = true
184+
});
178185

179186
// If any errors were written out, creation was not successful
180187
return errorString.Length == 0;

0 commit comments

Comments
 (0)