Skip to content

Cyrillic breaks CTRL+ combos #2865

Open

Description

@243083df

Environment

PS version: 7.1.4
PSReadline version: 2.1.0
os: 10.0.19041.1165 (WinBuild.160101.0800)
PS file version: 7.1.4.0
HostName: ConsoleHost
BufferWidth: 120
BufferHeight: 9001

Steps to reproduce

Open powershell 7.1.4 in windows terminal.
In cyrillic keymap press CTRL+С (C cyrillic)
CTRL not working and terminal show C
CTRL+A and CTRL+C not working after it in both keymaps

There is also another cases but it hard to reproduce.

Expected behavior

Actual behavior

CTRL+C working correctly

Activity

  1. ghost added
    Needs-Triage 🔍It's a new issue that core contributor team needs to triage.
    on Sep 17, 2021
  2. 243083df commented on Sep 17, 2021

    @243083df
    Author
  3. daxian-dbw commented on Sep 17, 2021

    @daxian-dbw
    Member

    What keyboard layout are you using?

  4. 243083df commented on Sep 19, 2021

    @243083df
    Author
  5. daxian-dbw commented on Sep 21, 2021

    @daxian-dbw
    Member

    Ilya (@iSazonov) Are you able to reproduce this issue?

  6. iSazonov commented on Sep 21, 2021

    @iSazonov

    No. The same PSRL 2.1.0 but PS 7.2:
    image

  7. daxian-dbw commented on Sep 21, 2021

    @daxian-dbw
    Member

    Thank you Ilya (@iSazonov)! You were using the Russian Keyboard, right?

  8. 243083df commented on Sep 21, 2021

    @243083df
    Author

    I come back with mysterious addition.
    When open PS and CTRL+C(Cyrillic), PS react like Cyrillic C entered. And when do CTRL+C just add c, and CTRL+Ф add 'ф', but if i switch layout to ENG, and input a then a will be added, but when i press CTRL+A then PS treat A as russian ф

  9. iSazonov commented on Sep 22, 2021

    @iSazonov

    Thank you Ilya (@iSazonov)! You were using the Russian Keyboard, right?

    Yes, and I switched to Russian layout.

  10. iSazonov commented on Sep 22, 2021

    @iSazonov

    Windows Terminal versionI I tested with is latest Preview 1.11.2421.

  11. daxian-dbw commented on Sep 23, 2021

    @daxian-dbw
    Member

    243083df Given that Ilya (@iSazonov) couldn't reproduce the issue using Russian Keyboard, we need more information on the repro steps. Can you be more specific on what keyboard you are using, what display language and default language, as well as what additional software you installed that you think may affect the language input on your machine?

  12. 243083df commented on Sep 28, 2021

    @243083df
    Author

    I debugged this problem and found what user32.dll works only with one locale with that it started.
    https://github.com/PowerShell/PSReadLine/blob/master/PSReadLine/Keys.cs#L150
    Since if you start PSReadline and press english CTRL+any then ToUnicode always return english chars in chars.
    And if you (re)start PSReadline and press cyrillic CTRL+any, ToUnicode always return cyrillic chars in chars.

    user32.dll has version 10.0.19041.1202

  13. 243083df commented on Sep 28, 2021

    @243083df
    Author
    Have this language settings

    image

    This for english

    image

    This for russian

    image

  14. 243083df commented on Oct 11, 2021

    @243083df
    Author

    Bug wont reproduce on ubuntu 20.04 LTS under WSL2. Same PC.

  15. 243083df commented on Oct 11, 2021

    @243083df
    Author

    I am debug further and find out that
    https://github.com/PowerShell/PSReadLine/blob/master/PSReadLine/ReadLine.cs#L103
    With ctrl return in KeyChar not ascii code, but alphabelic so CTRL+C become 3 '\u0003' and char.IsControl at https://github.com/PowerShell/PSReadLine/blob/master/PSReadLine/Keys.cs#L231
    return true

    Console.ReadKey(); return same result so seems thats it used to readkeys

  16. ForNeVeR commented on Nov 20, 2021

    @ForNeVeR
    Contributor

    This is a duplicate of #1393. You may also take a look at my previous attempt at fixing this, PR #1848.

    For the record, this still 100% reproduces for me using PowerShell 7.2 and any Windows Terminal (or conhost for that matter), on all of my Windows 10 and Windows 11 computers.

  17. ghost added
    In-PRA PR is opened targeting the issue
    on Dec 2, 2021
  18. o-sdn-o commented on Nov 15, 2024

    @o-sdn-o

    Stable repro (PSReadLine 2.4.0-beta0): microsoft/terminal#17197 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions