From 29846ba505610398f906994d7ac166527f63e514 Mon Sep 17 00:00:00 2001 From: Martin Zikmund Date: Sat, 4 Feb 2023 19:56:37 +0100 Subject: [PATCH] Ensure correct comparer is used for TextPrompt --- src/Spectre.Console/Prompts/ConfirmationPrompt.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Spectre.Console/Prompts/ConfirmationPrompt.cs b/src/Spectre.Console/Prompts/ConfirmationPrompt.cs index bedfb2efa..d1f5b820a 100644 --- a/src/Spectre.Console/Prompts/ConfirmationPrompt.cs +++ b/src/Spectre.Console/Prompts/ConfirmationPrompt.cs @@ -63,7 +63,8 @@ public bool Show(IAnsiConsole console) /// public async Task ShowAsync(IAnsiConsole console, CancellationToken cancellationToken) { - var prompt = new TextPrompt(_prompt) + var comparer = CaseInsensitive ? StringComparer.CurrentCultureIgnoreCase : StringComparer.CurrentCulture; + var prompt = new TextPrompt(_prompt, comparer) .InvalidChoiceMessage(InvalidChoiceMessage) .ValidationErrorMessage(InvalidChoiceMessage) .ShowChoices(ShowChoices)