You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Some keys on Japanese layout keyboards are incorrectly interpreted as @ #2206
Area-AccessibilityLabel for issues related to accessibility problems or improvementsIssue-BugIt either shouldn't be doing this or needs an investigation.
This is not character key - so nothing should happen and be displayed in console.
Actual behavior
Console prints @ key.
Backgrounds
I ran [console]::ReadKey() in pwsh and press "無変換(Muhenkan)" key.
KeyChar Key Modifiers
------- --- ---------
29 0
Japanese is not an alphabet, so I use an IME - Input Method Editor (e.g. Microsoft IME) to type it.
The "Muhenkan" key is for IME operation, so it does not send any characters.
It didn't occur with the "半角/全角(Hankaku/Zenkaku)" key and the "変換(Henkan)" key for operating Japanese IME.
However, if I press it together with the ALT key, the "@" will be displayed like "Muhenkan" key.
Reacted by ayzpc, tsubasa, tsukumi, mono, yukimemi, バクダンくん, KAMEDA Akihiro, ataihei, Daisuke Mutaguchi, ahiru and 7 more
Activity
ghost added
Needs-Triage 🔍It's a new issue that core contributor team needs to triage.
To add 0x1D (29) here will solve the problem. On the other hand, that constant should be available as ConsoleKey.NonConvert or such, so I added an issue to the .NET framework.
I have three PCs (two Win10 and one Win 11), and all the devices are now free from this problem thanks to the new version of Microsoft IME. The key code 29 is still sent (I checked that on https://keycode.info/), but the problem never happens. As Hiro (@hiro-mi) reported, with the Alt key, @ is still input. That doesn't matter for most of the people, I think, however.
I'm usually using Google Japanese Input. When I tried the new Microsoft-IME, pressing the "Muhenkan" key no longer typed "@".
However, as mentioned earlier, the new Microsoft-IME has many bugs. I'm used to Google Japanese Input, so I don't think I'll switch to the new Microsoft-IME just for this.
On US layout keyboards, the "Hankaku/Zenkaku" key does not exist.
If you want to do the same, you need to type Alt + ` , in which case @ will be typed as well as Alt + Hankaku/Zenkaku.
This occurs not only with Google IME, but also with MS-IME.
We hope this will be fixed, as it is a key binding frequently used by Japanese users of US keyboards.
Just so I am understanding this correct, the MS IME provides different key handlers for keys not available on US keyboards and the problem is that PSReadLine is not recognizing them correctly? Is this issue still persistent with latest versions of MS IME and PSReadLine? There may be a need to unbind default key handlers that conflict
Steven Bucher (@StevenBucher98)
I have tested with Powershell 7.3.3 and this issue continues to occur.
My environment as output by "$PSVersionTable" is as follows
PSVersion 7.3.3
PSEdition Core
GitCommitId 7.3.3
OS Microsoft Windows 10.0.19045
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
However, the same Issue does not occur with the following versions in the same PC.
I am using the latest Microsoft IME and PowerShell version 7.3.5. The issue of producing @ character on US keyboard while using the key combinations Alt-~ or Ctrl-~ still remains and quite annoying. Will there be any progress on resolving this?
The issue persists in PSReadLine version 2.4.0-beta, using PowerShell 5.1.19041.1682 (in Windows Terminal), with Google IME. Tried to change this keybind function through Set-PSReadLineKeyHandler in the profile settings, but it doesn't seem to work.
This still reproduces with PSReadLine 2.4.5 (latest on PSGallery).
Environment:
PSReadLine: 2.4.5
PowerShell: 7.6.9
OS: Windows 11 Pro 10.0.26200
Host: Windows Terminal 1.24.12741.0
Keyboard: Japanese (JIS) layout
IME: Google Japanese Input
Pressing the Muhenkan key (VK 0x1D) while the IME is off inserts @.
[Console]::ReadKey($true) reports Key=29, KeyChar=0, Modifiers=None, so the key arrives correctly.
Remove-Module PSReadLine makes the problem go away.
WhatIsKey (Alt+?) shows @: SelfInsert, so the key is indistinguishable from a real @ key.
Binding a script block to @ via Set-PSReadLineKeyHandler cannot tell the two apart either, so there is no PSReadLine-side workaround.
Current workaround is to bind vk(29) to a no-op action in Windows Terminal so the key never reaches PSReadLine.
As suggested above, adding 0x1D to the ignored keys in Keys.cs would fix this.
Area-AccessibilityLabel for issues related to accessibility problems or improvementsIssue-BugIt either shouldn't be doing this or needs an investigation.
Activity
tsukumijima commentedon Jun 14, 2021
I'm having the same problem. I hope it will be resolved as soon as possible.
cm3 commentedon Dec 21, 2021
PSReadLine/PSReadLine/Keys.cs
Lines 295 to 302 in ad74cef
I'm facing the same problem. This practice is not only ugly but also problematic.
cm3 commentedon Dec 21, 2021
PSReadLine/PSReadLine/Keys.cs
Lines 206 to 220 in 15850a4
To add
0x1D(29) here will solve the problem. On the other hand, that constant should be available asConsoleKey.NonConvertor such, so I added an issue to the .NET framework.cm3 commentedon Jan 7, 2022
I happened to find that using the new version of the Microsoft IME solve this problem in my environment. That IME had many bugs and I've used the previous version for a long time https://support.microsoft.com/en-us/windows/revert-to-a-previous-version-of-an-ime-input-method-editor-adcc9caa-17cb-44d8-b46e-f5b473b4dd77.
daxian-dbw commentedon Jan 7, 2022
Hiro (@hiro-mi) and tsukumi (@tsukumijima) Can you try the new version of Microsoft IME and see if that works for you too?
cm3 commentedon Jan 8, 2022
I have three PCs (two Win10 and one Win 11), and all the devices are now free from this problem thanks to the new version of Microsoft IME. The key code 29 is still sent (I checked that on https://keycode.info/), but the problem never happens. As Hiro (@hiro-mi) reported, with the Alt key,
@is still input. That doesn't matter for most of the people, I think, however.tsukumijima commentedon Jan 9, 2022
I'm usually using Google Japanese Input. When I tried the new Microsoft-IME, pressing the "Muhenkan" key no longer typed "@".
However, as mentioned earlier, the new Microsoft-IME has many bugs. I'm used to Google Japanese Input, so I don't think I'll switch to the new Microsoft-IME just for this.
ataihei commentedon Aug 8, 2022
On US layout keyboards, the "Hankaku/Zenkaku" key does not exist.
If you want to do the same, you need to type
Alt + `, in which case@will be typed as well asAlt + Hankaku/Zenkaku.This occurs not only with Google IME, but also with MS-IME.
We hope this will be fixed, as it is a key binding frequently used by Japanese users of US keyboards.
StevenBucher98 commentedon Mar 6, 2023
Just so I am understanding this correct, the MS IME provides different key handlers for keys not available on US keyboards and the problem is that PSReadLine is not recognizing them correctly? Is this issue still persistent with latest versions of MS IME and PSReadLine? There may be a need to unbind default key handlers that conflict
hiro-mi commentedon Mar 8, 2023
Steven Bucher (@StevenBucher98)
I have tested with Powershell 7.3.3 and this issue continues to occur.
My environment as output by "$PSVersionTable" is as follows
However, the same Issue does not occur with the following versions in the same PC.
The changes that were made between these versions may give some clues.
Konstantin-Glukhov commentedon Jul 11, 2023
I am using the latest Microsoft IME and PowerShell version 7.3.5. The issue of producing @ character on US keyboard while using the key combinations Alt-~ or Ctrl-~ still remains and quite annoying. Will there be any progress on resolving this?
makipom commentedon Nov 10, 2024
The issue persists in PSReadLine version 2.4.0-beta, using PowerShell 5.1.19041.1682 (in Windows Terminal), with Google IME. Tried to change this keybind function through Set-PSReadLineKeyHandler in the profile settings, but it doesn't seem to work.
docs(known-bugs): BUG-113の「@」表示形をPSReadLine#2206の既知バグで補足説明
skrtk98 commentedon Oct 28, 2026
This still reproduces with PSReadLine 2.4.5 (latest on PSGallery).
Environment:
Pressing the Muhenkan key (VK 0x1D) while the IME is off inserts
@.[Console]::ReadKey($true)reportsKey=29, KeyChar=0, Modifiers=None, so the key arrives correctly.Remove-Module PSReadLinemakes the problem go away.WhatIsKey(Alt+?) shows@: SelfInsert, so the key is indistinguishable from a real@key.@viaSet-PSReadLineKeyHandlercannot tell the two apart either, so there is no PSReadLine-side workaround.Current workaround is to bind
vk(29)to a no-op action in Windows Terminal so the key never reaches PSReadLine.As suggested above, adding 0x1D to the ignored keys in
Keys.cswould fix this.