clip

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package clip puts text on the clipboard of the person at the terminal and asks the terminal for what its clipboard holds

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(text string) tea.Cmd

Copies text for the person at the terminal: the clipboard tool of this machine where it is theirs, the tmux buffer inside tmux, and the terminal's clipboard sequence

func ForceSequence

func ForceSequence(on *bool)

Sets whether copies write the terminal's clipboard sequence whatever the connection, nil leaving that to the connection

func PowershellWriteScript

func PowershellWriteScript(b64 string) string

PowerShell command that sets the clipboard from base64 text

func Query

func Query() tea.Cmd

Asks the terminal for its clipboard, the answer arriving as a clipboard message

func Send

func Send(text string) tea.Cmd

Sends text to the clipboard of the terminal alone, through the multiplexer when the process runs in one

func StartCommand

func StartCommand(ctx context.Context, cmd string, args []string, stdin *string) bool

Runs a clipboard writer, piping the text to its stdin when given, true on a zero exit

func WriteText

func WriteText(ctx context.Context, text string) bool

Writes text to the host clipboard

func WriteTextWith

func WriteTextWith(ctx context.Context, text, platform string, start Start, env func(string) string) bool

Writes text through the first clipboard backend that succeeds, false when none did

Types

type Lookup

type Lookup func(string) (string, bool)

Environment lookup of the shape of os.LookupEnv

type Start

type Start func(ctx context.Context, cmd string, args []string, stdin *string) bool

Runs a command with optional stdin and reports a zero exit, the clipboard write seam

type WriteCmd

type WriteCmd struct {
	Cmd   string
	Args  []string
	Stdin bool
}

One clipboard write command, fed the text on stdin or through a PowerShell script argument

func WriteCommands

func WriteCommands(platform string, env func(string) string) []WriteCmd

Write commands to try in order for a platform and environment

Jump to

Keyboard shortcuts

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