Ctrl+/ (and possibly other editor keybindings) silently fail under native Wayland ozone platform; works when forced to X11
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
Title: Ctrl+/ (and possibly other editor keybindings) silently fail under native Wayland ozone platform; works when forced to X11
**Type:** Bug
**Description:**
On Linux with VS Code launched under native Wayland (`--ozone-platform=wayland`, auto-detected via `XDG_SESSION_TYPE=wayland`), `Ctrl+/` (Toggle Line Comment) does nothing when pressed as a keyboard shortcut — no error, no visible effect. Running the same command manually via the Command Palette ("Toggle Line Comment") works correctly, so the command and language grammar are fine; only the keybinding dispatch fails.
This happens in **both** English and Russian keyboard layouts, so it is not the known layout/OEM_2 remapping issue (see #287040, which is a different root cause). Explicitly rebinding to `ctrl+oem_2` in `keybindings.json` did not help either.
**Workaround that fixed it:** overriding the launch flags to force XWayland instead of native Wayland (`--ozone-platform=x11` instead of the auto-detected `wayland`) resolved the issue completely — the same `Ctrl+/` keybinding started working immediately after relaunch.
I noticed the running renderer/gpu process had `--enable-features=...,GlobalShortcutsPortal,...` enabled alongside `--ozone-platform=wayland`; flagging in case the global-shortcuts-via-portal path is intercepting/consuming this keystroke before it reaches the focused editor.
**To reproduce:**
1. On a native Wayland GNOME session (tested: Ubuntu 24.04, GNOME 46), launch VS Code normally (auto-detects Wayland).
2. Open any file, select/place cursor on a line.
3. Press `Ctrl+/`. Nothing happens.
4. Run "Toggle Line Comment" from the Command Palette — works fine.
5. Relaunch VS Code with `--ozone-platform=x11` explicitly. Press `Ctrl+/` again — now works.
**Environment:**
- VS Code: 1.129.1 (commit 8a7abeba6e03ea3af87bfbce9a1b7e48fed567b8)
- OS: Ubuntu 24.04.4 LTS, GNOME Shell 46, Wayland session (`XDG_SESSION_TYPE=wayland`)
- Not layout-dependent (reproduced in both `us` and `ru` xkb layouts)
Contributor guide
Assessment
This issue has not been assessed yet.