clipboard

package
v0.141.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopySelection added in v0.132.0

func CopySelection(text string) tea.Cmd

CopySelection copies text that the user selected with the mouse. It does what CopyToClipboard does and, on X11 and Wayland, also sets the primary selection, so a middle click pastes the text as it does after a selection in the terminal itself.

func CopyToClipboard

func CopyToClipboard(text string) tea.Cmd

CopyToClipboard writes text to both the system clipboard and via OSC 52. Returns a tea.Cmd that can be used in Bubble Tea's Update flow. When the system clipboard cannot be written, the command yields a NativeCopyFailedMsg, except where no system clipboard exists (see hasSystemClipboard).

Types

type NativeCopyFailedMsg added in v0.132.0

type NativeCopyFailedMsg struct {
	Err error
}

NativeCopyFailedMsg reports that the system clipboard could not be written, for example because no clipboard tool is installed. The text still went to the terminal as an OSC 52 sequence, which only some terminals support.

Jump to

Keyboard shortcuts

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