diff --git a/macos/Sources/Ghostty/Ghostty.Surface.swift b/macos/Sources/Ghostty/Ghostty.Surface.swift index a076063d5..0ccf51c9f 100644 --- a/macos/Sources/Ghostty/Ghostty.Surface.swift +++ b/macos/Sources/Ghostty/Ghostty.Surface.swift @@ -44,8 +44,9 @@ extension Ghostty { } } - /// Send text to the terminal as if it was typed. This doesn't send the key events so keyboard - /// shortcuts and other encodings do not take effect. + /// Send text to the terminal using paste semantics. This doesn't send key events, so keyboard + /// shortcuts and other encodings do not take effect. Bracketed paste framing is applied when + /// the terminal has enabled it. @MainActor func sendText(_ text: String) { let len = text.utf8CString.count diff --git a/macos/Sources/Ghostty/Surface View/SurfaceView_AppKit.swift b/macos/Sources/Ghostty/Surface View/SurfaceView_AppKit.swift index 0dbdeefef..06b185985 100644 --- a/macos/Sources/Ghostty/Surface View/SurfaceView_AppKit.swift +++ b/macos/Sources/Ghostty/Surface View/SurfaceView_AppKit.swift @@ -2305,10 +2305,7 @@ extension Ghostty.SurfaceView { if let content { DispatchQueue.main.async { - self.insertText( - content, - replacementRange: NSRange(location: 0, length: 0) - ) + self.surfaceModel?.sendText(content) } return true }