Add packaging and release automation
This commit is contained in:
parent
2a3b58c44e
commit
8e51e47587
1082 changed files with 356427 additions and 0 deletions
37
vendor/github.com/muesli/termenv/copy.go
generated
vendored
Normal file
37
vendor/github.com/muesli/termenv/copy.go
generated
vendored
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
package termenv
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/aymanbagabas/go-osc52/v2"
|
||||
)
|
||||
|
||||
// Copy copies text to clipboard using OSC 52 escape sequence.
|
||||
func (o Output) Copy(str string) {
|
||||
s := osc52.New(str)
|
||||
if strings.HasPrefix(o.environ.Getenv("TERM"), "screen") {
|
||||
s = s.Screen()
|
||||
}
|
||||
_, _ = s.WriteTo(o)
|
||||
}
|
||||
|
||||
// CopyPrimary copies text to primary clipboard (X11) using OSC 52 escape
|
||||
// sequence.
|
||||
func (o Output) CopyPrimary(str string) {
|
||||
s := osc52.New(str).Primary()
|
||||
if strings.HasPrefix(o.environ.Getenv("TERM"), "screen") {
|
||||
s = s.Screen()
|
||||
}
|
||||
_, _ = s.WriteTo(o)
|
||||
}
|
||||
|
||||
// Copy copies text to clipboard using OSC 52 escape sequence.
|
||||
func Copy(str string) {
|
||||
output.Copy(str)
|
||||
}
|
||||
|
||||
// CopyPrimary copies text to primary clipboard (X11) using OSC 52 escape
|
||||
// sequence.
|
||||
func CopyPrimary(str string) {
|
||||
output.CopyPrimary(str)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue