Closed whitequill closed 1 year ago
I think this is MSI configuration. Try to change key preferences
As a world leading gaming brand, MSI is the most trusted name in gaming and eSports. We stand by our principles of breakthroughs in design, and roll out the amazing gaming gear like motherboards, graphics cards, laptops and desktops.
I can also repro this on My Lenovo Yoga S730 ( quite an old machine now) so isn't just due to local machine configuration.
@whitequill please can you change the issue title to Pressing FN key puts @ symbol in pwsh console
as that's more fitting
Also I just tested this and I can only repro it when PSReadline module v2.2.6 is loaded which is bundled with Pwsh 7.3.4 - whether installed as MSI or via the store as MSIX - tested as per the below
Name Value
---- -----
PSVersion 7.3.4
PSEdition Core
GitCommitId 7.3.4
OS Microsoft Windows 10.0.25393
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Also I just tested this and I can only repro it when PSReadline module is loaded.
What version of PSReadline? I haven't tried 2.3.* yet.
@237dmitry updated my comment above - also not tested with 2.3.* versions as of yet
Still repros with 2.3.1.beta1 when running in 7.4.0-preview3 when not running in Windows Terminal
Name : PSReadLine
Version : 2.3.1
$_.PrivateData.PSData.PreRelease : beta1
Name Value
---- -----
PSVersion 7.4.0-preview.3
PSEdition Core
GitCommitId 7.4.0-preview.3
OS Microsoft Windows 10.0.25393
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
when not running in Windows Terminal
I tested on three laptops. Two of them with Linux on board and pwsh 7.4.0-preview3, PSReadline 2.2.6 and 2.3.1-beta1. And on a Windows laptop (pwsh 7.3.4, psreadline 2.2.6) and I couldn't reproduce the problem on any of them.
[console]::ReadKey()
is not reacted on pressing Fn
.
Tilix, alacritty, xfce4-terninal, conhost.exe, Windows Terminal.
@kilasuit What does [console]::ReadKey()
show when you press the Fn key?
I get this output
Can you try without PSReadline?
We discussed this in the Interactive UX WG this evening and concluded that this is due to an issue in PSReadLine so asking for this issue to be transferred to the PSReadline Repo
Specifically, the virtual key is being recorded as VK_NONE
& so the scan code is not mapped and therefore PSReadline should ignore it.
I cannot reproduce the issue with the ThinkPad laptop I have, which has the Fn
key on it. I agree this is likely due to the local machine configuration.
This issue is closed because it has been marked as requiring repro steps but has not had any activity for 7 days. If you think the issue is still relevant, please reopen and provide your feedback.
I have same issue with build-in Windows 2022 powershell during RDP remote sessions, but not reproduced with Windows 2019 or Win10/11.
>$PSVersiontable
Name Value
---- -----
PSVersion 5.1.20348.2400
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0, 5.0, 5.1.20348.2400}
BuildVersion 10.0.20348.2400
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
>Get-Module PSReadline
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 2.0.0 PSReadline {Get-PSReadLineKeyHandler, Get-PSReadLineOption, Remove-PSReadLineKeyHandler, Set-PSReadLineKeyHandler, Set-PSReadLineOption, PSConsoleHostReadLine}
@Largelos For what you ran into, I believe it's been fixed in newer versions. Please try upgrading to the latest stable version v2.3.5 and try it out.
No, reproduced also with v2.3.5. But I'm not sure if this is the PSReadline module issue, because win2019/win10 have same build-in v2.0.0, and FN key doesn't write anything. Also, I reproduce this issue at RDP win11 session too, if run powershell.exe directly, instead of through Windows Console Host (conhost.exe)
Prerequisites
Steps to reproduce
When I press the Fn (Function) button on the MSI Raider GE76 gamer laptop in Powershell 7.3.4 the key returns an "@" symbol in text output. The Fn Key is used for miscellaneous functions such as, use of the Home,End, Sys Rq keys as well volume up, down and mute; screen brightness up and down; Airplain mode, and all secondary functions on the F-keys.
It's most annoying due to when I want to press the home or end keys a string of "@" symbols appears till I let go of the Function key. I can press and hold the Function key in Notepad and it acts as expected.
The problem does not occur in the Terminal App that can be downloaded from the Windows Store.
Expected behavior
Actual behavior
Error details
Environment data
Visuals