macos: restore paste semantics for dropped text (#13999)

Discussion #13979

Dropped paths and text once again honor bracketed paste mode. IME,
dictation, emoji picker, and character viewer commits remain typed
input.

sendText calls ghostty_surface_text, which applies the clipboard paste
pipeline and bracketed paste framing when enabled. Separating the paths
at the drag-and-drop caller preserves the input-method behavior
introduced by #13817.
This commit is contained in:
Mitchell Hashimoto
2026-08-24 13:25:53 -07:00
committed by GitHub
2 changed files with 4 additions and 6 deletions

View File

@@ -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

View File

@@ -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
}