modulepackage
0.0.0-20131010032410-8136607ea412
Repository: https://github.com/ahmetb/go-cursor.git
Documentation: pkg.go.dev
# README
go-cursor
Provides ANSI escape sequences (strings) for manipulating cursor on terminals.
Usage
Here is equivalent of clear
program (cls
command on Windows) written in Go
using go-cursor
:
package main
import (
"fmt"
"github.com/ahmetalpbalkan/go-cursor"
)
func main() {
fmt.Print(cursor.ClearEntireScreen())
fmt.Print(cursor.MoveTo(0, 0))
}
# Functions
ClearEntireLine returns ANSI escape sequence to clear current line.
ClearEntireScreen returns ANSI escape sequence to clear the screen.
ClearLineLeft returns ANSI escape sequence to clear line from left of the cursor.
ClearLineRight returns ANSI escape sequence to clear line from right of the cursor.
ClearScreenDown returns ANSI escape sequence to clear screen below.
ClearScreenUp returns ANSI escape sequence to clear screen above.
Hide returns ANSI escape sequence to hide the cursor.
MoveDown returns ANSI escape sequence to move cursor down n lines.
MoveLeft returns ANSI escape sequence to move cursor left n columns.
MoveNextLine returns ANSI escape sequence to move cursor to next line.
MoveRight returns ANSI escape sequence to move cursor right n columns.
MoveTo returns ANSI escape sequence to move cursor to specified position on screen.
MoveUp returns ANSI escape sequence to move cursor up n lines.
MoveUpperLeft returns ANSI escape sequence to move cursor to upper left corner of screen.
RestoreAttributes returns ANSI escape sequence to restore saved position and attributes of the cursor.
SaveAttributes returns ANSI escape sequence to save current position and attributes of the cursor.
Show returns ANSI escape sequence to show the cursor.
# Variables
No description provided by the author