terminal

package
v0.0.0-...-b9ddc22 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: Unlicense Imports: 4 Imported by: 0

Documentation

Overview

Adapted from https://gitlab.com/binanary/terminal

Index

Constants

This section is empty.

Variables

View Source
var Cursor = cursor{
	MoveUp:    func(n int) { fmt.Print(prefix, n, "A") },
	MoveDown:  func(n int) { fmt.Print(prefix, n, "B") },
	MoveLeft:  func(n int) { fmt.Print(prefix, n, "D") },
	MoveRight: func(n int) { fmt.Print(prefix, n, "C") },
	GoToLine:  func(n int) { fmt.Print(prefix, n, ";0H") },
	// contains filtered or unexported fields
}

Functions that affect the cursor

Functions

func AwaitAnyKey

func AwaitAnyKey()

Pause execution until the user hits any key

func Clear

func Clear()

Removes all visible content from the terminal (equivalent to using the "clear" command)

func ClearLine

func ClearLine()

Clears the cursor's current line in the terminal and places the cursor at the leftmost position in that line

func GetNextKey

func GetNextKey() int

Intercepts the user's next keypress and returns the string representation of the key

func Notify

func Notify()

Uses the terminal's bell feature to get the user's attention

func Reset

func Reset()

func ResetFormatting

func ResetFormatting()

Ends any currently-set text formatting, including styles and colors

func ScrollUp

func ScrollUp(n int)

Moves the viewport (and cursor) up n lines. Useful for removing an unwanted new line added by the enter key.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳