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

This commit is contained in:
Mitchell Hashimoto
2025-08-19 14:23:47 -07:00
parent 1c96870c17
commit 63ca777e0f

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: "")