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

Open
#3,508 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp
Domain
cli

Research direction

Reproduce the behavior with Set-PSReadLineKeyHandler and Get-PSReadLineKeyHandler using '?' and 'Ctrl+Alt+?'. Trace the chord parsing and key-binding lookup, then add a regression test showing that '?' remains unbound and is inserted while 'Ctrl+Alt+?' invokes the configured function.

Written by the indexing model from the issue text.

Description

Area-KeyHandlers Issue-Bug
Prerequisites
  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • 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'.
Dominant language
C#
Stars
4.4k
Forks
341
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PowerShell/PSReadLine

All issues in PowerShell/PSReadLine

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.