Skip to content

Commit 421f754

Browse files
mxvshclaude
andcommitted
fix: always use Cmd+V for paste to work in terminal and all apps
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 8926968 commit 421f754

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

Wave/Services/PasteService.swift

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,9 @@ import Carbon.HIToolbox
44

55
struct PasteService {
66
static func paste(text: String) {
7-
// Try AX insertion first — works in native AppKit fields without touching clipboard
8-
if pasteViaAX(text) { return }
9-
// Fall back to clipboard + Cmd+V — works everywhere (Terminal, web, Electron, etc.)
107
pasteViaKeyboard(text)
118
}
129

13-
@discardableResult
14-
private static func pasteViaAX(_ text: String) -> Bool {
15-
let systemWide = AXUIElementCreateSystemWide()
16-
var focusedElement: CFTypeRef?
17-
guard AXUIElementCopyAttributeValue(systemWide, kAXFocusedUIElementAttribute as CFString, &focusedElement) == .success,
18-
let element = focusedElement else { return false }
19-
let result = AXUIElementSetAttributeValue(element as! AXUIElement, kAXSelectedTextAttribute as CFString, text as CFString)
20-
return result == .success
21-
}
22-
2310
private static func pasteViaKeyboard(_ text: String) {
2411
let pasteboard = NSPasteboard.general
2512

0 commit comments

Comments
 (0)