diff --git a/macos/Sources/Ghostty/AppState.swift b/macos/Sources/Ghostty/AppState.swift index 55a5b7b50..8ecaf0941 100644 --- a/macos/Sources/Ghostty/AppState.swift +++ b/macos/Sources/Ghostty/AppState.swift @@ -334,7 +334,9 @@ extension Ghostty { } static private func completeClipboardRequest(_ surface: ghostty_surface_t, data: String, state: UnsafeMutableRawPointer?) { - ghostty_surface_complete_clipboard_request(surface, data, UInt(data.count), state) + data.withCString { ptr in + ghostty_surface_complete_clipboard_request(surface, ptr, UInt(data.utf8.count), state) + } } static func writeClipboard(_ userdata: UnsafeMutableRawPointer?, string: UnsafePointer?, location: ghostty_clipboard_e) {