cursor

package
v1.33.2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package cursor provides functionality to interact with the terminal cursor.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EraseLine added in v1.1.0

func EraseLine(fw terminal.FileWriter)

EraseLine erases a line from a FileWriter.

func EraseLinesAbove added in v1.1.0

func EraseLinesAbove(fw terminal.FileWriter, n int)

EraseLinesAbove erases a line and moves the cursor up from fw, repeated n times.

func TestEraseLine added in v1.21.0

func TestEraseLine(t *testing.T)

TestEraseLine is POSIX-only since the implementation in the underlying library is completely different on Windows.

Types

type Cursor

type Cursor struct {
	// contains filtered or unexported fields
}

Cursor represents the terminal's cursor.

func New

func New() *Cursor

New creates a new cursor that writes to stderr.

func NewWithWriter added in v1.1.0

func NewWithWriter(out io.Writer) *Cursor

NewWithWriter creates a new cursor that writes to out.

func (*Cursor) Down

func (c *Cursor) Down(n int)

Down moves the cursor n lines.

func (*Cursor) EraseLine

func (c *Cursor) EraseLine()

EraseLine deletes the contents of the current line.

func (*Cursor) Hide added in v1.1.0

func (c *Cursor) Hide()

Hide makes the cursor invisible.

func (*Cursor) Show added in v1.1.0

func (c *Cursor) Show()

Show makes the cursor visible.

func (*Cursor) Up

func (c *Cursor) Up(n int)

Up moves the cursor n lines.

Jump to

Keyboard shortcuts

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