util

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package util provides utility functions for UI message handling.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CmdHandler

func CmdHandler(msg tea.Msg) tea.Cmd

func ExecShell

func ExecShell(ctx context.Context, cmdStr string, callback tea.ExecCallback) tea.Cmd

ExecShell parses a shell command string and executes it with exec.Command. Uses shell.Fields for proper handling of shell syntax like quotes and arguments while preserving TTY handling for terminal editors.

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 ClearStatusMsg

type ClearStatusMsg struct{}

type Cursor

type Cursor interface {
	Cursor() *tea.Cursor
}

type InfoMsg

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

func NewErrorMsg

func NewErrorMsg(err error) InfoMsg

func NewInfoMsg

func NewInfoMsg(info string) InfoMsg

func NewWarnMsg

func NewWarnMsg(warn string) InfoMsg

func (InfoMsg) IsEmpty

func (m InfoMsg) IsEmpty() bool

IsEmpty checks if the InfoMsg is empty.

type InfoType

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

Jump to

Keyboard shortcuts

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