Skip to content

Fix chord shortcuts on Windows non-Latin keyboard layouts#9476

Merged
acarl005 merged 1 commit intowarpdotdev:masterfrom
landkirk:landkirk/fix-windows-non-latin-chord-shortcuts
May 3, 2026
Merged

Fix chord shortcuts on Windows non-Latin keyboard layouts#9476
acarl005 merged 1 commit intowarpdotdev:masterfrom
landkirk:landkirk/fix-windows-non-latin-chord-shortcuts

Conversation

@landkirk
Copy link
Copy Markdown
Contributor

@landkirk landkirk commented Apr 29, 2026

Fixes #9036.

Description

On Windows, non-Latin keyboard layouts (Cyrillic, Greek, Arabic, etc.) translate the physical key to a non-ASCII character even when Ctrl/Cmd is held. That makes bindings like ctrl-c / ctrl-v (and the terminal's copy/paste shortcuts) fail to match — users have to switch their system layout to English just to copy or paste in Warp.

This change detects that situation in convert_keyboard_input_event and substitutes the US-QWERTY character that the physical key would produce, so chord shortcuts work regardless of the active OS layout. Same approach used by VS Code, JetBrains, and Chromium.

The fallback is gated on cfg(windows) and on Ctrl/Super being held with a non-ASCII character — typed text on non-Latin layouts is unaffected.

Testing

Unit tests in key_events_tests.rs cover the new us_qwerty_fallback_for_chord helper:

  • Letter mappings (KeyAa, etc.)
  • Digit and punctuation mappings
  • Returns None for keys outside the chord-shortcut set (function keys, modifiers, navigation), so the original logical_key is preserved
  • Returns None for PhysicalKey::Unidentified

Manually verified on Windows:

  • Copy / Select All / Paste with English (US) layout
  • Copy / Select All / Paste with Russian layout
  • Copy / Select All / Paste with German layout
  • AltGr (Right Alt) bindings with German layout

Server API dependencies

No server API changes.

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

CHANGELOG-BUG-FIX: Fixed Ctrl/Cmd shortcuts (e.g. copy, paste) failing on Windows when a non-Latin keyboard layout was active.

@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Apr 29, 2026

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @landkirk on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment @cla-bot check to trigger another check.

@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented Apr 29, 2026

@landkirk

I'm starting a first review of this pull request.

I requested changes on this pull request and posted feedback.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

I'm re-reviewing this pull request in response to a review request.

I reviewed this pull request and requested human review from: @vorporeal. I left feedback as a comment so a maintainer can approve.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

I reviewed this pull request and requested human review from: @zachbai.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

You can view the conversation on Warp.

I reviewed this pull request and requested human review from: @vorporeal.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

oz-for-oss[bot]
oz-for-oss Bot previously requested changes Apr 29, 2026
Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

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

Overview

This PR adds a Windows-only fallback that maps non-ASCII logical character keys with Ctrl/Super held back to their US-QWERTY physical-key characters so shortcut matching can work on non-Latin layouts.

Concerns

  • The fallback also applies when Windows reports AltGr/right-Alt text entry as Ctrl+Alt, which can turn typed non-ASCII AltGr characters into Ctrl+Alt ASCII keystrokes and let shortcuts intercept text input. No security concerns were identified in the changed code.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread crates/warpui/src/windowing/winit/event_loop/key_events.rs
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Apr 29, 2026

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @landkirk on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment @cla-bot check to trigger another check.

@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Apr 29, 2026

The cla-bot has been summoned, and re-checked this pull request!

@landkirk
Copy link
Copy Markdown
Contributor Author

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed label Apr 29, 2026
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Apr 29, 2026

The cla-bot has been summoned, and re-checked this pull request!

@landkirk landkirk marked this pull request as draft April 29, 2026 20:05
@landkirk landkirk force-pushed the landkirk/fix-windows-non-latin-chord-shortcuts branch 2 times, most recently from b161c5f to 5bac90d Compare April 29, 2026 21:33
@landkirk
Copy link
Copy Markdown
Contributor Author

/oz-review

@landkirk landkirk marked this pull request as ready for review April 29, 2026 21:36
Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

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

Overview

This PR adds a Windows-only fallback that maps non-ASCII logical keys back to their US-QWERTY physical-key characters when Ctrl/Super chord shortcuts are pressed, plus unit coverage for the mapping helper.

Concerns

  • No blocking correctness or security concerns found in the changed lines.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss Bot requested a review from vorporeal April 29, 2026 21:38
Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

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

Overview

This PR adds a Windows-only US-QWERTY physical-key fallback for Ctrl/Super chord shortcuts when the active layout reports a non-ASCII logical key, plus unit coverage for the helper.

Concerns

  • Shifted digit/punctuation chords are not preserved by the fallback: Ctrl+Shift+] on a non-Latin layout becomes ctrl-shift-] instead of the US-QWERTY shifted ctrl-shift-}, so default shifted-symbol bindings can still fail.
  • No security concerns found in the changed key-event mapping code.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread crates/warpui/src/windowing/winit/event_loop/key_events.rs Outdated
@oz-for-oss oz-for-oss Bot requested a review from zachbai April 29, 2026 21:41
@vorporeal vorporeal requested review from acarl005 and removed request for vorporeal and zachbai April 29, 2026 22:02
@vorporeal
Copy link
Copy Markdown
Contributor

handing this off to @acarl005, who is our main windows guy

On Windows, non-Latin keyboard layouts (Cyrillic, Greek, Arabic, etc.)
translate the physical key to a non-ASCII character even when Ctrl/Cmd
is held, so bindings like ctrl-c / ctrl-v fail to match. Detect that
case and substitute the US-QWERTY character the physical key would
produce, mirroring how VS Code, JetBrains, and Chromium handle it.

Fixes warpdotdev#9036.
@landkirk landkirk force-pushed the landkirk/fix-windows-non-latin-chord-shortcuts branch from 5bac90d to 86f3071 Compare April 29, 2026 22:32
@landkirk
Copy link
Copy Markdown
Contributor Author

/oz-review

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

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

Overview

This PR adds a Windows-only fallback that maps non-ASCII logical keys from Ctrl/Super chord events back to US-QWERTY physical-key characters, with unit coverage for the helper mappings and fallthrough cases.

Concerns

  • No blocking correctness findings found in the changed diff.
  • Security pass: no security concerns identified.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss Bot requested a review from vorporeal April 30, 2026 02:20
@vorporeal vorporeal removed their request for review April 30, 2026 15:52
@captainsafia captainsafia added the external-contributor Indicates that a PR has been opened by someone outside the Warp team. label Apr 30, 2026 — with Warp Dev Github Integration
Copy link
Copy Markdown
Contributor

@acarl005 acarl005 left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

@acarl005
Copy link
Copy Markdown
Contributor

acarl005 commented May 3, 2026

/oz-review

@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 3, 2026

@acarl005

I'm re-reviewing this pull request in response to a review request.

You can view the conversation on Warp.

I reviewed this pull request and requested human review from: @vorporeal.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss Bot dismissed their stale review May 3, 2026 08:57

Oz no longer requests changes for this pull request after the latest automated review.

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

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

Overview

This PR adds a Windows-only fallback that maps non-ASCII Ctrl/Super chord characters back to their US-QWERTY physical-key equivalent, with tests for the helper mapping and unmapped keys. I did not find correctness or security issues in the changed lines.

Concerns

  • None.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss Bot requested a review from vorporeal May 3, 2026 08:57
@acarl005 acarl005 merged commit 03ef4d0 into warpdotdev:master May 3, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed external-contributor Indicates that a PR has been opened by someone outside the Warp team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

You cannot paste copied text if your keyboard is not set to the English layout. It is also not possible to copy text from the terminal.

4 participants