Skip to content

Commit

Permalink
Support PowerShell user input prompts
Browse files Browse the repository at this point in the history
When PowerShell prompted for input the text entered in the console
window was not being used. Implemented support for this.
  • Loading branch information
mrward committed Apr 10, 2022
1 parent 451e28a commit 06569ec
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,15 @@ public void GrabFocus ()

void OnConsoleInput (object sender, ConsoleInputEventArgs e)
{
ConsoleInput?.Invoke (sender, e);
if (userInputTask != null) {
// Waiting for user input. Bypass the usual processing.
WriteOutputLine (string.Empty, ScriptingStyle.Out);

userInputTask.TrySetResult (e.Text);
userInputTask = null;
} else {
ConsoleInput?.Invoke (sender, e);
}
}

public event EventHandler TextViewFocused;
Expand Down

0 comments on commit 06569ec

Please sign in to comment.