From 0e8b0d199afae82f2d6ec2b01d82fd7aed337588 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 22 Jun 2025 16:04:15 +0200 Subject: [PATCH] Hack Warp Enter --- mac/VibeTunnel/Utilities/TerminalLauncher.swift | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mac/VibeTunnel/Utilities/TerminalLauncher.swift b/mac/VibeTunnel/Utilities/TerminalLauncher.swift index 64101cb7..f16ee979 100644 --- a/mac/VibeTunnel/Utilities/TerminalLauncher.swift +++ b/mac/VibeTunnel/Utilities/TerminalLauncher.swift @@ -164,6 +164,8 @@ enum Terminal: String, CaseIterable { } // Special handling for Warp terminal + // Warp doesn't recognize standard key codes for Enter (36 or 76) + // and requires ASCII character 13 (carriage return) to execute commands if self == .warp { return """ tell application "\(processName)" @@ -171,12 +173,12 @@ enum Terminal: String, CaseIterable { tell application "System Events" -- Create new window keystroke "n" using {command down} - delay 0.5 + delay 1.0 -- Paste command from clipboard keystroke "v" using {command down} - delay 0.3 - -- Try numeric keypad Enter with small delay - key code 76 + delay 0.5 + -- Warp requires ASCII character 13 instead of key code 36 + keystroke (ASCII character 13) end tell end tell """