...
1 package termenv
2
3 import (
4 "strings"
5
6 "github.com/aymanbagabas/go-osc52/v2"
7 )
8
9
10 func (o Output) Copy(str string) {
11 s := osc52.New(str)
12 if strings.HasPrefix(o.environ.Getenv("TERM"), "screen") {
13 s = s.Screen()
14 }
15 _, _ = s.WriteTo(o)
16 }
17
18
19
20 func (o Output) CopyPrimary(str string) {
21 s := osc52.New(str).Primary()
22 if strings.HasPrefix(o.environ.Getenv("TERM"), "screen") {
23 s = s.Screen()
24 }
25 _, _ = s.WriteTo(o)
26 }
27
28
29 func Copy(str string) {
30 output.Copy(str)
31 }
32
33
34
35 func CopyPrimary(str string) {
36 output.CopyPrimary(str)
37 }
38
View as plain text