lterm

package module
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2025 License: MIT Imports: 4 Imported by: 4

README

lterm

{ repos: github.com/laktak/lterm, codeberg.org/laktak/lterm }

lterm is a basic terminal package for go.

Used in:

Example

bg := lterm.Bg8(240)
fg1 := lterm.Fg8(235)
fg2 := lterm.Fg8(228)

lterm.Printline(bg, " test", fg1, " foo ", fg2, "bar ", lterm.Reset)

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Reset         = "\033[0m"
	Bold          = "\033[01m"
	Disable       = "\033[02m"
	Underline     = "\033[04m"
	Reverse       = "\033[07m"
	Strikethrough = "\033[09m"
	Invisible     = "\033[08m"

	SaveCursor    = "\033[s"
	RestoreCursor = "\033[u"
)

Functions

func Bg4 added in v1.3.0

func Bg4(col int) string

func Bg8

func Bg8(col int) string

func ClearLine

func ClearLine(opt int) string

func Fg4

func Fg4(col int) string

func Fg8

func Fg8(col int) string

func GetTermColorBits added in v1.4.0

func GetTermColorBits() int

func GetUseColor added in v1.2.0

func GetUseColor() bool

func GetUseTerminal added in v1.2.0

func GetUseTerminal() bool

func GetWidth

func GetWidth() int

func Move added in v1.5.0

func Move(c Cursor, n int) string

func Move1 added in v1.5.0

func Move1(c Cursor) string

func Printline

func Printline(text ...interface{})

func Write

func Write(text ...interface{})

Types

type Cursor added in v1.5.0

type Cursor int
const (
	CursorUp Cursor = iota
	CursorDown
	CursorLeft
	CursorRigth
)

Jump to

Keyboard shortcuts

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