Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion PSReadLine/Keys.cs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,12 @@ void AppendPart(string str)
// another special key, such as 'Ctrl+?' and 'Ctrl+;'.
isDeadKey = (c == '\0') && (consoleKey >= ConsoleKey.Oem1 && consoleKey <= ConsoleKey.Oem102) && !isCtrl;

if (!isDeadKey)
// For standard Ctrl+letter combinations (KeyChar \x01-\x1A), the mapping
// to letters a-z is well-defined and layout-independent, so we skip the
// ToUnicodeEx call which would return a layout-dependent character
// (e.g. Cyrillic 'с' instead of Latin 'c' on Russian layout), breaking
// key binding matching.
if (!isDeadKey && !(c >= 1 && c <= 26))
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change alters how Ctrl+letter chords are normalized on Windows, but there’s no automated coverage to prevent regressions (especially for non-English layouts like ru-RU). Please add a unit/integration test that validates Ctrl+C (and ideally a couple other Ctrl+letter chords) still normalize to the expected Latin chord string even when the active keyboard layout is Russian (skip the test if the layout isn’t available on the runner).

Copilot uses AI. Check for mistakes.
Comment thread
bn45hkurr0y4 marked this conversation as resolved.
Outdated
{
// A dead key could pass the above heuristic check, such as 'Shift+6' in US-INTL keyboard, which represents the
// diacritic '^' and generates 'D6' ConsoleKey, '\0' key char and 'Shift' modifier.
Expand Down
Loading