util

package
v0.705.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CopyToClipboard = copyToClipboard

CopyToClipboard places text on the clipboard. It makes a best-effort call to the OS clipboard helper (xclip/xsel/wl-copy/pbcopy) AND always emits an OSC 52 escape sequence to the terminal. OSC 52 needs no helper binary and works over SSH and on Wayland sessions where those helpers are frequently absent (WezTerm, COSMIC Terminal, ...), which is why the OS-helper path alone failed silently. Returns false only for empty input.

It is a package variable, not a plain function, so callers that need to verify a copy happened (settings actions, tests) can swap in a fake without touching a real terminal or the OS clipboard.

Functions

func AlertError added in v0.2.0

func AlertError(msg string) tea.Cmd

AlertError creates a bubbleup error overlay alert.

func AlertInfo added in v0.2.0

func AlertInfo(msg string) tea.Cmd

AlertInfo creates a bubbleup info overlay alert.

func AlertPersist added in v0.2.0

func AlertPersist(alertType, msg string) tea.Cmd

AlertPersist creates a persistent bubbleup alert that stays until Esc is pressed.

func AlertWarn added in v0.2.0

func AlertWarn(msg string) tea.Cmd

AlertWarn creates a bubbleup warning overlay alert.

func Clamp

func Clamp(v, low, high int) int

func CmdHandler

func CmdHandler(msg tea.Msg) tea.Cmd

func ReportError

func ReportError(err error) tea.Cmd

func ReportInfo

func ReportInfo(info string) tea.Cmd

func ReportWarn

func ReportWarn(warn string) tea.Cmd

Types

type AlertMsg added in v0.2.0

type AlertMsg struct {
	Type    string // bubbleup alert key: "Info", "Warn", "Error"
	Msg     string
	Persist bool // if true, alert stays until dismissed with Esc
}

AlertMsg triggers a bubbleup overlay alert instead of the status bar.

type ClearStatusMsg

type ClearStatusMsg struct{}

type InfoMsg

type InfoMsg struct {
	Type InfoType
	Msg  string
	TTL  time.Duration
}

type InfoType

type InfoType int
const (
	InfoTypeInfo InfoType = iota
	InfoTypeWarn
	InfoTypeError
)

Jump to

Keyboard shortcuts

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