app: keybinds match the produced character, so Ctrl+F and other letter shortcuts fail on non-Latin layouts
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 82/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Bắt đầu từ packages/app/src/shell/commands/command.tsx, nơi có keyFromKeyboardEvent và matchKeybind, và đọc chúng cùng với các khai báo keybind trong cùng thư mục. Trên bố cục tiếng Nga, event.key là chữ Kirin còn event.code vẫn là KeyF, vì vậy hãy bỏ điều kiện !event.altKey để cơ chế dự phòng theo phím vật lý bao phủ Ctrl/Meta/Shift, sau đó ánh xạ các mã dấu câu (Comma, Period, Semicolon, Quote, BracketLeft, BracketRight, Backslash). Hoàn thành khi Ctrl+F mở thanh tìm kiếm trên bố cục không dùng chữ Latinh, các bind khác trong danh sách đều kích hoạt và các bài kiểm thử command hiện có đều xanh.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
App keybinds are matched against event.key (the character produced by the active
layout) and only fall back to the physical event.code when Alt is held. On
non-Latin layouts (e.g. Russian) event.key is Cyrillic, so letter and punctuation
shortcuts silently do nothing unless Alt is involved.
Example: the session find bar added in #48470 is bound to mod+f. On an English
layout Ctrl+F opens it; on a Russian layout it does nothing. session.search is
registered with hidden: true, so the command palette cannot reach it either — the
shortcut is the only entry point, and on a Cyrillic layout it never fires.
Root cause — packages/app/src/shell/commands/command.tsx:
export function keyFromKeyboardEvent(event: KeyboardEvent) {
const key = normalizeKey(event.key)
if (!event.altKey || /^[a-z0-9]$/.test(key)) return key
if (!event.code.startsWith("Key") || event.code.length !== 4) return key
return event.code.slice(3).toLowerCase()
}
matchKeybind compares the configured key ("f") with keyFromKeyboardEvent(event).
With a Russian layout, Ctrl+F arrives as event.key === "а", event.code === "KeyF",
event.altKey === false, so the function returns "а" and "f" !== "а" — no match.
Alt+F does match, so the event.code fallback exists but is gated on Alt (it was
added for macOS Option). Ctrl/Meta/Shift on a non-Latin layout are not covered.
The same applies to mod+p, mod+t, mod+w, mod+u, mod+shift+a/e/l/o/r/s/t/x,
mod+shift+d, and the punctuation binds mod+comma, mod+., mod+;, mod+',
mod+[, mod+], mod+\\. Digit binds (mod+1..9) are fine because the digit row
matches across these layouts.
Suggested fix: remove the !event.altKey gate so the physical-key fallback applies to
every modifier (this keeps the macOS Option behavior), and additionally map event.code
for the punctuation keys used in keybinds (Comma, Period, Semicolon, Quote,
BracketLeft, BracketRight, Backslash, …).
Related, but not the same:
- #40048 — "Keybind Ctrl + . does not work with non-US keyboard layouts (e.g., Russian)"
— identical root cause, auto-closed by the stale bot, not fixed. - #6364 — "Hotkeys don't work if the keyboard layout isn't english" — same, auto-closed.
- #54708 — handles
Dead/Unidentifiedkeys; hereevent.keyis a valid character, so
that fallback does not trigger. - #55371 — open, but the TUI (terminal input / Kitty protocol); the app path is separate.
Plugins
None
OpenCode version
2.0.29 (desktop app)
Steps to reproduce
- Open the desktop app on Windows and switch the keyboard layout to Russian (ЙЦУКЕН).
- Open a session and press
Ctrl+Fon the physical F key. → Nothing happens. - Switch to the English layout and press the same physical keys. → The find bar opens.
- Still in the Russian layout,
Alt+Fmatches whileCtrl+Fdoes not.
Screenshot and/or share link
N/A
Operating System
Windows 11 (10.0.22631)
Terminal
N/A — desktop app
- Ngôn ngữ chính
- TypeScript
- Star
- 213k
- Fork
- 28.4k
- Merge trung bình
- 8 giờ 58 phút
- Pull request đã merge (30 ngày)
- 251
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của anomalyco/opencode
-
reproduced
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
anomalyco/opencode#56038 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
anomalyco/opencode#56002 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
tui: NumPad End/Home ignored under kitty keyboard protocol (Windows Terminal reports KP_END 57424)Có thể đã có người làm @argszero đã nhận hôm nay. Đang mởreproduced
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
anomalyco/opencode#55533 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
anomalyco/opencode#55383 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
web: second Firefox tab never connects to /api/event - Cache-Control: no-cache lets Firefox's HTTP cache block concurrent SSE requestsCó thể đã có người làm @zonemeen đã nhận 2 ngày trước. Đang mởreproduced
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
anomalyco/opencode#55369 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của anomalyco/opencode
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
aws/agentcore-cli#2606 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ai-driven-qa bug Cosmetic
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ai-driven-qa bug claude Minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
linagora/twake-mail-admin#301 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Add: Yemen Education SDĐang mởstreams:add
Độ khó 2/5 Dưới một giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày