osc52

package module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2022 License: MIT Imports: 5 Imported by: 6

README

go-osc52

Latest Release GoDoc

A terminal Go library to copy text to clipboard from anywhere. It does so using ANSI OSC52. The Copy() function defaults to copying text from terminals running locally.

To use this over SSH, using gliderlabs/ssh, use NewOutput(sshSession, sshSession.Environ()) and make sure you pass the TERM environment variable in your SSH connection.

ssh -o SendEnv=TERM <host>

Tmux users need to pass an additional environment variable TMUX.

ssh -o SendEnv=TERM -o SendEnv=TMUX <host>

Credits

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(str string)

Copy copies the OSC52 string to the output. This is the default copy function.

Types

type Output

type Output struct {
	// contains filtered or unexported fields
}

Output is where the OSC52 string should be written.

func NewOutput

func NewOutput(out io.Writer, envs []string) *Output

NewOutput returns a new Output.

func (*Output) Copy

func (o *Output) Copy(str string)

Copy copies the OSC52 string to the output.

Directories

Path Synopsis
_examples
ssh

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL