term

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clear

func Clear()

Clear clears the screen.

func ClearScrollback

func ClearScrollback()

ClearScrollback clears iTerm2 scrollback.

func CursorMove

func CursorMove(d Direction, n int)

CursorMove moves the cursor n times in the direction d.

func CursorPosition

func CursorPosition(row, col int)

CursorPosition moves cursor to row, col.

func CursorRestorePosition

func CursorRestorePosition()

CursorRestorePosition restores the cursor position/state.

func CursorSavePosition

func CursorSavePosition()

CursorSavePosition saves the cursor position/state.

func HasGraphicsSupport

func HasGraphicsSupport() bool

func HideCursor

func HideCursor()

HideCursor hides cursor.

func NewImageWriter

func NewImageWriter(width, height int) io.WriteCloser

func Rows

func Rows() (rows int, err error)

Rows returns the number of rows for the controling terminal.

func ShowCursor

func ShowCursor()

ShowCursor shows cursor.

Types

type Direction

type Direction string

Direction constants are to be used with CursorMove.

const (
	// Up moves the cursor up.
	Up Direction = "A"
	// Down moves the cursor down.
	Down Direction = "B"
	// Forward moves the cursor forward.
	Forward Direction = "C"
	// Backward moves the cursor backward.
	Backward Direction = "D"
	// NextLine cursor to beginning of the line next line.
	NextLine Direction = "E"
	// PreviousLine cursor to beginning of the line previous line.
	PreviousLine Direction = "F"
	// HorizontalAbsolute the cursor to the specified column.
	HorizontalAbsolute Direction = "G"
)

type TermSize

type TermSize struct {
	Row    int
	Col    int
	Width  int
	Height int
}

TermSize contains sizing information of the terminal.

func Size

func Size() (size TermSize, err error)

Size gathers sizing information of the current session's controling terminal.

Jump to

Keyboard shortcuts

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