Repository navigation
fix(win32): '~' followed by '/' only outputs '~' - #17
Merged
Merged
Conversation
A dead key followed by a non-combining key (e.g. '~' then '/') makes ToUnicode return two UTF-16 units. Only the first was forwarded, so PowerShell via ConPTY received '~' without '/'. Send one event per unit. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Keep additional dead-key and ligature text neutral, preserve surrogate ordering across repeats, and retranslate coalesced repetitions after consuming a dead key. Track the native dead-key state through both encoders and clear it on focus loss. Exercise complete PTY input packets with a fake native translator, without desktop-global input or keyboard-layout changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On dead-key layouts,
ToUnicodecan return multiple UTF-16 units for one press, such as~/. Keeping only the first unit dropped text in Win32 Input Mode.Preserve every valid returned unit within the supplied buffer. Generated prefix/continuation text follows the existing neutral Win32 character-event path, while each logical physical press retains its virtual key, scan code, modifiers, and eventual key-up. Re-translate coalesced repeats after dead-key composition, preserve surrogate/ligature ordering, and clear tracked dead-key state on focus loss. Ordinary character and non-text events retain compact repeat counts.
Added a deterministic regression that injects translation/key-state results and checks the actual I/O mailbox packets. It covers non-combining and composed dead keys, coalesced repeats of dead keys and ordinary keys, surrogate pairs, ligatures, modifiers, releases, buffer bounds/trailing data, keyboard-state failure, focus reset, and read-only input. It needs no live keyboard input or layout changes.
Focused filter:
Win32 Input Mode preserves translated text without replaying physical keys. The contributor also reported manual French-layout verification in WSL, PowerShell, and cmd.exe.Additional native consumer verification: all 10 raw
ReadConsoleInputWcases passed through the bundled ConPTY, including baseline repeat shapes, generated prefix text, composed/literal repeats, surrogate pairs, ligatures, modifiers, and release records. AConsole.ReadKeyrepeat quirk reproduces with the unchanged original single-packet baseline in both PowerShell 5.1 and 7; the encoder keeps the correct Win32 repeat counts. This verifies packet interpretation, not live physical keyboard-layout translation.The final combined candidate passed selected Windows callback/wire tests (86 passed, one platform declaration skipped), debug and stripped fast builds, and the 21-check tab/session UI regression.