tui

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EscapeNormal    = []byte{27, '[', '0', 'm'}
	EscapeBold      = []byte{27, '[', '1', 'm'}
	EscapeFaint     = []byte{27, '[', '2', 'm'}
	EscapeItalic    = []byte{27, '[', '3', 'm'}
	EscapeUnderline = []byte{27, '[', '4', 'm'}
	EscapeInvert    = []byte{27, '[', '7', 'm'}
)

Functions

func Clear

func Clear()

Clear clears the terminal.

func EditInEditor

func EditInEditor(s string) (string, error)

Edit the string s using the editor defined by the environment variable EDITOR.

func Print

func Print(a ...interface{})

func Printf

func Printf(format string, a ...interface{})

func Println

func Println(a ...interface{})

func ReadPassword

func ReadPassword(prompt string) string

ReadPassword reads a line of input from the user, but doesn't echo to the screen.

func Readline

func Readline(prompt string) string

Readline reads a line of input from the user.

func Start

func Start()

func Stop

func Stop()

func TermSize

func TermSize() (w, h int)

func WrapText

func WrapText(s string, width int) ([]string, int)

WrapText takes the text in s and wraps it to the width. It returns the individual wrapped lines, and the length of the longest wrapped line.

If the width is less than or equal to zero, it is set to the terminal width.

In order to wrap the text in a reasonable way, white space is trimmed and collapsed througout the text.

func Write

func Write(b []byte)

Write sends raw bytes to the terminal.

Types

This section is empty.

Jump to

Keyboard shortcuts

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