clipboard.go 741 B

12345678910111213141516171819202122232425
  1. package input
  2. import "github.com/charmbracelet/x/ansi"
  3. // ClipboardSelection represents a clipboard selection. The most common
  4. // clipboard selections are "system" and "primary" and selections.
  5. type ClipboardSelection = byte
  6. // Clipboard selections.
  7. const (
  8. SystemClipboard ClipboardSelection = ansi.SystemClipboard
  9. PrimaryClipboard ClipboardSelection = ansi.PrimaryClipboard
  10. )
  11. // ClipboardEvent is a clipboard read message event. This message is emitted when
  12. // a terminal receives an OSC52 clipboard read message event.
  13. type ClipboardEvent struct {
  14. Content string
  15. Selection ClipboardSelection
  16. }
  17. // String returns the string representation of the clipboard message.
  18. func (e ClipboardEvent) String() string {
  19. return e.Content
  20. }