Help us shape the future of Go! Take the 2026 Go Developer Survey

termui

package
v0.57.21 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run[T any](
	ctx context.Context,
	input *os.File,
	output io.Writer,
	initial T,
	updates <-chan T,
	render func(T) string,
) error

Run renders a live terminal screen until the context or update channel stops it.

func RunWithKeys added in v0.51.8

func RunWithKeys[T any](
	ctx context.Context,
	input *os.File,
	output io.Writer,
	initial T,
	updates <-chan T,
	render func(T) string,
	keyHandler KeyHandler[T],
) error

RunWithKeys renders a live terminal screen and forwards keypresses.

func Write

func Write(output io.Writer, text string) error

Write replaces the current terminal screen with text.

Types

type KeyHandler added in v0.51.8

type KeyHandler[T any] func(T, byte)

KeyHandler handles a raw key byte from the terminal.

Jump to

Keyboard shortcuts

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