macos: show the copy menu item if we have any text selected

pull/8288/head
Mitchell Hashimoto 2025-08-19 14:23:47 -07:00
parent 1c96870c17
commit 63ca777e0f
No known key found for this signature in database
GPG Key ID: 523D5DC389D273BC
1 changed files with 1 additions and 1 deletions

View File

@ -1327,7 +1327,7 @@ extension Ghostty {
var item: NSMenuItem
// If we have a selection, add copy
if self.selectedRange().length > 0 {
if let text = self.accessibilitySelectedText(), text.count > 0 {
menu.addItem(withTitle: "Copy", action: #selector(copy(_:)), keyEquivalent: "")
}
menu.addItem(withTitle: "Paste", action: #selector(paste(_:)), keyEquivalent: "")