iterm2.go 426 B

123456789101112131415161718
  1. package ansi
  2. import "fmt"
  3. // ITerm2 returns a sequence that uses the iTerm2 proprietary protocol. Use the
  4. // iterm2 package for a more convenient API.
  5. //
  6. // OSC 1337 ; key = value ST
  7. //
  8. // Example:
  9. //
  10. // ITerm2(iterm2.File{...})
  11. //
  12. // See https://iterm2.com/documentation-escape-codes.html
  13. // See https://iterm2.com/documentation-images.html
  14. func ITerm2(data any) string {
  15. return "\x1b]1337;" + fmt.Sprint(data) + "\x07"
  16. }