diff --git a/Sources/Shellraiser/Infrastructure/Ghostty/GhosttyRuntime.swift b/Sources/Shellraiser/Infrastructure/Ghostty/GhosttyRuntime.swift index a1b169c..7babe79 100644 --- a/Sources/Shellraiser/Infrastructure/Ghostty/GhosttyRuntime.swift +++ b/Sources/Shellraiser/Infrastructure/Ghostty/GhosttyRuntime.swift @@ -711,13 +711,15 @@ final class GhosttyRuntime { } } - /// Reads text from the host pasteboard and completes a pending Ghostty request. + /// Accepts a Ghostty clipboard-read request and completes it on the main actor. + /// + /// Returns `false` only when the runtime cannot take ownership of the request at all. nonisolated private static func readClipboard( userdata: UnsafeMutableRawPointer?, clipboard: ghostty_clipboard_e, requestState: UnsafeMutableRawPointer? - ) { - guard let hostView = hostView(from: userdata) else { return } + ) -> Bool { + guard let hostView = hostView(from: userdata) else { return false } Task { @MainActor in guard let surface = hostView.surfaceHandleForCallbacks else { return } @@ -731,6 +733,8 @@ final class GhosttyRuntime { let text = pasteboard.opinionatedStringContents ?? "" completeClipboardRequest(surface: surface, text: text, requestState: requestState) } + + return true } /// Handles clipboard-read confirmation requests conservatively by denying them. diff --git a/ghostty b/ghostty index 703d11c..332b2ae 160000 --- a/ghostty +++ b/ghostty @@ -1 +1 @@ -Subproject commit 703d11c642a96af9e54b55b04f131bf3888948a9 +Subproject commit 332b2aefc6e72d363aa93ab6ecfc86eeeeb5ed28