[Functional-Command Palette] - Case sensitive commands in Russian localization #13617

Closed
opened 2026-01-31 03:47:29 +00:00 by claunia · 5 comments
Owner

Originally created by @whatsupbros on GitHub (Apr 24, 2021).

User Experience:
Users of Russian Windows localization can be confused, because commands are case sensitive. So, "Новая вкладка" ("New tab") command cannot be found with "новая" ("new") input string in lowercase, but can be found with "Новая" ("New"), which preserves the case.

Test Environment:
App: Windows Terminal 1.7.1033.0
Feature: Command Palette
OS: Microsoft Windows [Version 10.0.19042.928]

Repro Steps:

  1. Open Windows terminal app
  2. Open Command Palette using shortcut (ctrl+shift+p)
  3. Search for New tab command in the search field in Russian, use "новая" search string for this and see the empty result:
    1
  4. Now use "Новая" instead, see the different result
    2

Expected:
Commands in Command Pallete to be case insensitive.
In fact, commands should be findable in English also, even is Russian localization of the OS.

So, both "new" or "новая" search strings should find "Новая вкладка" command (which is Russian translation for "New tab").

Originally created by @whatsupbros on GitHub (Apr 24, 2021). **User Experience:** Users of Russian Windows localization can be confused, because commands are case sensitive. So, "Новая вкладка" ("New tab") command cannot be found with "новая" ("new") input string in lowercase, but can be found with "Новая" ("New"), which preserves the case. **Test Environment:** App: Windows Terminal 1.7.1033.0 Feature: Command Palette OS: Microsoft Windows [Version 10.0.19042.928] **Repro Steps:** 1. Open Windows terminal app 2. Open Command Palette using shortcut (ctrl+shift+p) 3. Search for New tab command in the search field in Russian, use "новая" search string for this and see the empty result: ![1](https://user-images.githubusercontent.com/667976/115973186-6a58b880-a553-11eb-8be5-c95dab724dc0.png) 4. Now use "Новая" instead, see the different result ![2](https://user-images.githubusercontent.com/667976/115973191-6f1d6c80-a553-11eb-9108-899bb7f16423.png) **Expected:** Commands in Command Pallete to be case insensitive. In fact, commands should be findable in English also, even is Russian localization of the OS. So, both "new" or "новая" search strings should find "Новая вкладка" command (which is Russian translation for "New tab").
Author
Owner

@Don-Vito commented on GitHub (Apr 25, 2021):

@ZZa - thanks for reporting.

It looks that we added locale aware case-sensitivity for commands sorting, but not for command filtering. Inside FilteredCommand::_computeHighlightedName we have:

const auto lowerCaseSearchChar = std::towlower(searchChar);
...
auto isCurrentCharMatched = std::towlower(commandName[currentOffset]) == lowerCaseSearchChar;

In the code above std::towlower uses default locale that for some reason is not Russian locale.

@Don-Vito commented on GitHub (Apr 25, 2021): @ZZa - thanks for reporting. It looks that we added locale aware case-sensitivity for commands sorting, but not for command filtering. Inside `FilteredCommand::_computeHighlightedName` we have: ``` const auto lowerCaseSearchChar = std::towlower(searchChar); ... auto isCurrentCharMatched = std::towlower(commandName[currentOffset]) == lowerCaseSearchChar; ``` In the code above `std::towlower` uses default locale that for some reason is not Russian locale.
Author
Owner

@Don-Vito commented on GitHub (Apr 25, 2021):

Forgot to mention, that the trivial fix is to use the same approach we have for sorting (lstrcmpi) to compare chars.
(There are other approaches, but I think this one is both trivial and robust).

@zadjii-msft - please assign this to me (hope to fix it later on).

@Don-Vito commented on GitHub (Apr 25, 2021): Forgot to mention, that the trivial fix is to use the same approach we have for sorting (lstrcmpi) to compare chars. (There are other approaches, but I think this one is both trivial and robust). @zadjii-msft - please assign this to me (hope to fix it later on).
Author
Owner

@Don-Vito commented on GitHub (Apr 25, 2021):

OK.. it was kinda "one-liner", so I did it, though didn't test it in Russian.

@Don-Vito commented on GitHub (Apr 25, 2021): OK.. it was kinda "one-liner", so I did it, though didn't test it in Russian.
Author
Owner

@ghost commented on GitHub (May 25, 2021):

:tada:This issue was addressed in #9943, which has now been successfully released as Windows Terminal v1.8.1444.0.🎉

Handy links:

@ghost commented on GitHub (May 25, 2021): :tada:This issue was addressed in #9943, which has now been successfully released as `Windows Terminal v1.8.1444.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.8.1444.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Author
Owner

@ghost commented on GitHub (May 25, 2021):

:tada:This issue was addressed in #9943, which has now been successfully released as Windows Terminal Preview v1.9.1445.0.🎉

Handy links:

@ghost commented on GitHub (May 25, 2021): :tada:This issue was addressed in #9943, which has now been successfully released as `Windows Terminal Preview v1.9.1445.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.9.1445.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#13617