Files
ghostty/macos/Sources/Helpers/Extensions/OSPasteboard+Extension.swift
Lukas daab08ec01 macOS: drop the cross-platform check and abstraction
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-12 14:00:03 +02:00

20 lines
466 B
Swift

import AppKit
/// Convenience interface for working with pasteboard strings.
extension NSPasteboard {
@MainActor static let find = NSPasteboard(name: .find)
/// The pasteboard's current string value.
@MainActor var string: String? {
get {
string(forType: .string)
}
set {
clearContents()
if let newValue {
setString(newValue, forType: .string)
}
}
}
}