Skip to content

Commit 09e5fbc

Browse files
committed
Final tweaks and polish for console UI behavior
1 parent 3a48280 commit 09e5fbc

File tree

5 files changed

+2224
-2240
lines changed

5 files changed

+2224
-2240
lines changed

src/PowerShellEditorServices.Protocol/Server/PromptHandlers.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ private void HandlePromptResponse(
9191

9292
if (!response.PromptCancelled)
9393
{
94+
this.consoleService.WriteOutput(
95+
response.ResponseText,
96+
OutputType.Normal);
97+
9498
this.readLineTask.TrySetResult(response.ResponseText);
9599
}
96100
else
@@ -178,6 +182,10 @@ private void HandlePromptResponse(
178182

179183
if (!response.PromptCancelled)
180184
{
185+
this.consoleService.WriteOutput(
186+
response.ResponseText,
187+
OutputType.Normal);
188+
181189
this.readLineTask.TrySetResult(response.ResponseText);
182190
}
183191
else

src/PowerShellEditorServices/Console/ConsoleChoicePromptHandler.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ protected override void ShowPrompt(PromptStyle promptStyle)
8888
.Select(choice => this.Choices[choice].Label));
8989

9090
this.consoleHost.WriteOutput(
91-
$" (default is \"{choiceString}\"):");
91+
$" (default is \"{choiceString}\"): ",
92+
false);
9293
}
9394
}
9495

@@ -102,7 +103,7 @@ protected override Task<string> ReadInputString(CancellationToken cancellationTo
102103
/// </summary>
103104
/// <param name="responseString">The string representing the user's response.</param>
104105
/// <returns>
105-
/// True if the prompt is complete, false if the prompt is
106+
/// True if the prompt is complete, false if the prompt is
106107
/// still waiting for a valid response.
107108
/// </returns>
108109
protected override int[] HandleResponse(string responseString)

src/PowerShellEditorServices/Console/ConsoleReadLine.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ internal class ConsoleReadLine
2323

2424
private PowerShellContext powerShellContext;
2525
private AsyncQueue<ConsoleKeyInfo> readKeyQueue = new AsyncQueue<ConsoleKeyInfo>();
26-
private CancellationTokenSource readLoopCancellationToken;
2726

2827
#endregion
2928

0 commit comments

Comments
 (0)