From dd33c9717bcdaf2128232a7fcb35fac9f6158fdb Mon Sep 17 00:00:00 2001 From: U9G Date: Sat, 21 Mar 2026 20:35:20 -0400 Subject: [PATCH 1/2] Fix arrow key events not reaching web content in BrowserView The before-input-event handler in tryHandleCommand was intercepting all arrow key + modifier combinations (Cmd+Arrow, Option+Arrow, etc.) and routing them to vscode's command system instead of letting them pass through to web content. This broke standard text navigation in the built-in browser: Cmd+Arrow for line start/end, Option+Arrow for word navigation, Option+Shift+Arrow for word selection, etc. Let all arrow key events pass through to web content unconditionally. --- src/vs/platform/browserView/electron-main/browserView.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/vs/platform/browserView/electron-main/browserView.ts b/src/vs/platform/browserView/electron-main/browserView.ts index 085229a7c5dbe..7c4f9df69ce9e 100644 --- a/src/vs/platform/browserView/electron-main/browserView.ts +++ b/src/vs/platform/browserView/electron-main/browserView.ts @@ -688,9 +688,15 @@ export class BrowserView extends Disposable implements ICDPTarget { keyCode >= KeyCode.F1 && keyCode <= KeyCode.F24 || keyCode >= KeyCode.AudioVolumeMute; + // Arrow keys are standard text navigation (word, line, document movement + // and selection) — always let them pass through to web content. + if (isArrowKey) { + return false; + } + // Ignore most Alt-only inputs (often used for accented characters or menu accelerators) const isAltOnlyInput = input.alt && !input.control && !input.meta; - if (isAltOnlyInput && !isNonEditingKey && !isArrowKey) { + if (isAltOnlyInput && !isNonEditingKey) { return false; } From ed0608e76e083ce10cf7c25f0d27468497789abd Mon Sep 17 00:00:00 2001 From: U9G Date: Sat, 21 Mar 2026 20:35:33 -0400 Subject: [PATCH 2/2] Fix Enter key not reaching web content in BrowserView Enter was classified as a "non-editing key" in tryHandleCommand, causing it to be intercepted and routed to vscode's command system instead of being delivered to web page input handlers. This broke typing in text inputs, forms, and editors (e.g. Monaco) within the built-in browser. Remove Enter from the non-editing key list so it passes through to web content. --- src/vs/platform/browserView/electron-main/browserView.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/vs/platform/browserView/electron-main/browserView.ts b/src/vs/platform/browserView/electron-main/browserView.ts index 7c4f9df69ce9e..c4bc3b5bc914e 100644 --- a/src/vs/platform/browserView/electron-main/browserView.ts +++ b/src/vs/platform/browserView/electron-main/browserView.ts @@ -683,7 +683,6 @@ export class BrowserView extends Disposable implements ICDPTarget { const isArrowKey = keyCode >= KeyCode.LeftArrow && keyCode <= KeyCode.DownArrow; const isNonEditingKey = - keyCode === KeyCode.Enter || keyCode === KeyCode.Escape || keyCode >= KeyCode.F1 && keyCode <= KeyCode.F24 || keyCode >= KeyCode.AudioVolumeMute;