PSReadLine icon indicating copy to clipboard operation
PSReadLine copied to clipboard

Setting a key handler for 'Ctrl+Alt+?' sets the same key handler for '?'

Open masaru-iritani opened this issue 2 years ago • 2 comments

Prerequisites

  • [X] Write a descriptive title.
  • [X] Make sure you are able to repro it on the latest released version
  • [X] Search the existing issues, especially the pinned issues.

Exception report

N/A

Screenshot

N/A

Environment data

PS Version: 7.3.0
PS HostName: ConsoleHost (Windows Terminal)
PSReadLine Version: 2.2.6
PSReadLine EditMode: Windows
OS: 10.0.25262.1000 (WinBuild.160101.0800)
BufferWidth: 120
BufferHeight: 30

Steps to reproduce

  1. Launch PowerShell.
  2. Run Set-PSReadLineKeyHandler -Chord 'Ctrl+Alt+?' -Function ShowKeyBindings.
  3. Type "?".

Expected behavior

"?" is inserted into the command line.

Actual behavior

The list of key bindings appears. "?" is not inserted into the command line.

Notes

  • After step 2, Get-PSReadLineKeyHandler -Chord '?' returns a key binding same with Get-PSReadLineKeyHandler -Chord 'Ctrl+Alt+?'.
  • This bug is reproduced with Windows PowerShell 5.1 / PowerShell 7.3.0 on Windows Terminal / conhost.exe.
  • This bug is reproduced for other functions such as ShowCommandHelp
  • This bug is NOT reproduced for other keys such as 'Ctrl+Alt+K'.

masaru-iritani avatar Dec 09 '22 10:12 masaru-iritani

I have a hunch that this is because Ctrl+? is the ASCII 'delete' control character.

andyleejordan avatar Dec 09 '22 17:12 andyleejordan

I have a hunch that this is because Ctrl+? is the ASCII 'delete' control character.

I'm afraid it is not the case, since I'm having the same issue but with shift. I set "Shift+E" and I can't type "E" in uppercase at all, since it recognizes the "Shift+E" as uppercase "E". So yeah, if I use CAPSLOCK and then type "E" it would execute the command but not show the letter at all. It also applies to pasting. If I paste, let's say: "I LOVE BURGERS" it would then output "I LOV BURGRS".

Captura de tela 2024-03-12 111040

Captura de tela 2024-03-12 111029

As you can see in the images, I have set the command like the documentation suggests but in the pwsh it shows as I set just the uppercase letter.

luidera22 avatar Mar 12 '24 14:03 luidera22