mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-08-26 17:11:40 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user