Skip to content
Open
Changes from all commits
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 >= '\x01' && c <= '\x1A'))
{
// 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