tui

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2021 License: MIT Imports: 10 Imported by: 0

README

tui

Text user interface for golang.

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 added in v0.0.2

func EditInEditor(s string) (string, error)

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

func Print added in v0.0.2

func Print(a ...interface{})

func Printf added in v0.0.2

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

func Println added in v0.0.2

func Println(a ...interface{})

func ReadPassword added in v0.0.2

func ReadPassword(prompt string) string

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

func Readline added in v0.0.2

func Readline(prompt string) string

Readline reads a line of input from the user.

func Start

func Start()

func Stop

func Stop()

func TermSize added in v0.0.2

func TermSize() (w, h int)

func WrapText added in v0.0.2

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 added in v0.0.2

func Write(b []byte)

Write sends raw bytes to the terminal.

Types

This section is empty.

Directories

Path Synopsis
example

Jump to

Keyboard shortcuts

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