ui

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearLocalFrame

func ClearLocalFrame()

ClearLocalFrame removes the cached local preview so the UI can fall back to status text.

func ClearRemoteFrame

func ClearRemoteFrame()

ClearRemoteFrame removes the cached remote preview, allowing the UI to show status text.

func EnsureRenderer

func EnsureRenderer(ctx context.Context)

EnsureRenderer starts the terminal renderer loop once. Subsequent calls are no-ops.

func NetRateSnapshot

func NetRateSnapshot() (txAudio, txVideo, rxAudio, rxVideo float64)

func PeerLatencySnapshot

func PeerLatencySnapshot() time.Duration

func PeerSlot

func PeerSlot() (cols, rows int, ok bool)

PeerSlot returns the cached viewport slot dimensions learned from the remote peer.

func RequestRedraw

func RequestRedraw()

RequestRedraw enqueues a redraw event for the terminal renderer.

func SelfSlot

func SelfSlot() (cols, rows int, ok bool)

SelfSlot returns the current viewport slot dimensions for the local terminal.

func SetColorFilter

func SetColorFilter(key string)

SetColorFilter applies a named tint to subsequent frame renders. Empty key clears the filter.

func SetCopyableStatus

func SetCopyableStatus(msg, clipboard string)

SetCopyableStatus shows the provided message and makes it clickable so the text is copied via OSC-52.

func SetLocalFrame

func SetLocalFrame(frame *codec.TextFrame) bool

SetLocalFrame updates the cached local preview frame if the viewport is ready. It returns true when the frame was accepted.

func SetPeerTermSize

func SetPeerTermSize(cols, rows int)

SetPeerTermSize updates the cached viewport slot dimensions requested by the remote peer.

func SetRemoteFrame

func SetRemoteFrame(frame *codec.TextFrame) bool

SetRemoteFrame updates the cached remote preview frame. It returns true when the frame was accepted.

func SetStatusMessage

func SetStatusMessage(msg string)

SetStatusMessage updates the fallback text rendered when no frames are available. The message is trimmed; pass an empty string to clear it.

func SetVideoFPSLimit added in v0.1.0

func SetVideoFPSLimit(fps int)

SetVideoFPSLimit changes how often viewport frames are accepted. Pass <=0 to disable throttling.

func UpdatePeerLatency

func UpdatePeerLatency(latency time.Duration)

func UpdateRxAudioRate

func UpdateRxAudioRate(kBps float64)

func UpdateRxVideoRate

func UpdateRxVideoRate(kBps float64)

func UpdateTxAudioRate

func UpdateTxAudioRate(kBps float64)

func UpdateTxVideoRate

func UpdateTxVideoRate(kBps float64)

Types

type TermSize

type TermSize struct {
	Cols int
	Rows int
}

TermSize represents the terminal size in character cells.

type TermSizeFeed

type TermSizeFeed struct {
	Updates <-chan TermSize
	Initial *TermSize
	Stop    func()
}

TermSizeFeed exposes a stream of terminal size events along with the last known size. Call Stop when the consumer no longer needs updates.

func NewTermSizeFeed

func NewTermSizeFeed(ctx context.Context) TermSizeFeed

NewTermSizeFeed creates a TermSizeFeed bound to ctx. When ctx is canceled or Stop is invoked, the feed stops forwarding updates and the Updates channel is closed.

type ViewportSize

type ViewportSize struct {
	Cols int
	Rows int
}

type ViewportSizeFeed

type ViewportSizeFeed struct {
	Updates <-chan ViewportSize
	Initial *ViewportSize
	Stop    func()
}

ViewportSizeFeed exposes a stream of viewport size requests learned from the local layout.

func NewViewportFeed

func NewViewportFeed(ctx context.Context) ViewportSizeFeed

NewViewportFeed creates a ViewportSizeFeed bound to ctx.

Jump to

Keyboard shortcuts

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