mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-05-24 05:40:15 +00:00
macOS: enable copy only when there’s actual selected text
This commit is contained in:
@@ -2121,6 +2121,14 @@ extension Ghostty.SurfaceView: NSMenuItemValidation {
|
||||
item.state = readonly ? .on : .off
|
||||
return true
|
||||
|
||||
case #selector(copy(_:)):
|
||||
// We only enable copy menu item when there're actual selected text
|
||||
if let text = self.accessibilitySelectedText(), text.count > 0 {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
|
||||
default:
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user