[wrangler] fix: hotkeys work with Caps Lock enabled#13834
Conversation
🦋 Changeset detectedLatest commit: 81abf63 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Codeowners approval required for this PR:
Show detailed file reviewers |
There was a problem hiding this comment.
Pull request overview
Fixes Wrangler dev-server hotkey matching when Caps Lock is enabled by accommodating Node.js readline’s { name: "x", shift: true } emission pattern, and updates tests/changeset accordingly.
Changes:
- Add a Shift-only normalization fallback so plain hotkeys (e.g.
"b") still match whenreadlinereportsshift: truewith a lowercasename. - Update the Caps Lock test fixture to reflect actual
readlinekey event shape and add coverage for ctrl/meta + shift behavior. - Add a patch changeset documenting the fix.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/wrangler/src/cli-hotkeys.ts | Adds Shift-only fallback matching to make Caps Lock hotkeys work. |
| packages/wrangler/src/tests/cli-hotkeys.test.ts | Updates Caps Lock modeling and adds related regression tests. |
| .changeset/fix-hotkeys-case-insensitive.md | Documents the behavior change as a patch release note. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@NuroDev @penalosa @dario-piotrowicz — all Copilot review comments have been addressed. This PR is ready for review. |
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
workers-devprod
left a comment
There was a problem hiding this comment.
Codeowners reviews satisfied
Co-authored-by: Edmund Hung <edmund@cloudflare.com>
Fixes #13449.
When Caps Lock is on (or Shift is held without Ctrl/Meta), Node.js
readlineemits key events as{ name: "a", shift: true }— lowercase letter withshift: true. The hotkey matcher was building"shift+b"from this and comparing against registered keys like"b", silently ignoring the keypress.Fix: When
shiftis the sole active modifier (noctrl, nometa), the matcher now also checks the plain key name alongside the"shift+key"form. This means:bwith Caps Lock on → emits{ name: "b", shift: true }→ builds"shift+b", also tries"b"→ matchesCtrl+C→ still only matches"ctrl+c"(shift fallback only applies when shift is the sole modifier)"shift+a"bindings still work via exact match oncharTest fix: The existing
"handles CAPSLOCK"test was modelling Caps Lock as{ name: "A", shift: false }(uppercase name, no shift flag) — but readline actually emits lowercase name withshift: true. Updated to accurately reflect readline's behavior.