diff --git a/src/ui/desktop/apps/features/terminal/Terminal.tsx b/src/ui/desktop/apps/features/terminal/Terminal.tsx index dcee59c4..89c19b00 100644 --- a/src/ui/desktop/apps/features/terminal/Terminal.tsx +++ b/src/ui/desktop/apps/features/terminal/Terminal.tsx @@ -1349,6 +1349,24 @@ export const Terminal = forwardRef( return true; } + // Ctrl+Alt+ → Ctrl+ remapping for browser-blocked shortcuts + // Browsers intercept Ctrl+W/T/N/Q, so we use Ctrl+Alt as an alternative + if (e.ctrlKey && e.altKey && !e.metaKey && !e.shiftKey) { + const key = e.key.toLowerCase(); + const blockedKeys = ["w", "t", "n", "q"]; + if (blockedKeys.includes(key)) { + e.preventDefault(); + e.stopPropagation(); + const ctrlCode = key.charCodeAt(0) - 96; + if (webSocketRef.current?.readyState === 1) { + webSocketRef.current.send( + JSON.stringify({ type: "input", data: String.fromCharCode(ctrlCode) }), + ); + } + return false; + } + } + if (showAutocompleteRef.current) { if (e.key === "Escape") { e.preventDefault();