terminalcode

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2023 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EraseScreen
	// https://vt100.net/docs/vt100-ug/chapter3.html#ED
	// 擦除整个屏幕
	EraseScreen = "\x1b[2J"

	// EraseEndOfLine https://vt100.net/docs/vt100-ug/chapter3.html#EL
	// 擦除从光标位置到当前行尾的范围(包括光标位置)
	EraseEndOfLine = "\x1b[K"

	// EraseDown https://vt100.net/docs/vt100-ug/chapter3.html#ED
	// 擦除从当前行到屏幕底部的范围
	EraseDown = "\x1b[J"

	// CarriageReturn 移动光标到行首
	CarriageReturn = "\r"
	NEWLINE        = "\n"
	CRLF           = "\r\n"

	// HideCursor 隐藏光标
	HideCursor = "\x1b[?25l"
	// DisplayCursor 显示光标
	DisplayCursor = "\x1b[?25h"

	ResetAttributes = "\x1b[0m"

	// EnableX10Mouse X10MouseEnable 开启 X10 鼠标上报
	EnableX10Mouse  = "\x1b[?9h"
	DisableX10Mouse = "\x1b[?9l"

	// RequestCursorPosition 请求光标位置 ref: https://vt100.net/docs/vt510-rm/CPR.html
	RequestCursorPosition = "\x1b[6n"
)

Variables

This section is empty.

Functions

func CursorBackward

func CursorBackward(amount int) string

CursorBackward 向左移动光标

func CursorDown

func CursorDown(amount int) string

CursorDown 向下移动光标

func CursorForward

func CursorForward(amount int) string

CursorForward 向右移动光标

func CursorGoto

func CursorGoto(x, y int) string

CursorGoto 移动光标到指定位置

func CursorUp

func CursorUp(amount int) string

CursorUp https://vt100.net/docs/vt100-ug/chapter3.html#CUU 向上移动光标

Types

This section is empty.

Jump to

Keyboard shortcuts

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