Documentation ¶
Index ¶
- Constants
- Variables
- func CursorBack(n int)
- func CursorDown(n int)
- func CursorForward(n int)
- func CursorHide()
- func CursorHorizontalAbsolute(x int)
- func CursorMove(x int, y int)
- func CursorNextLine(n int)
- func CursorPreviousLine(n int)
- func CursorShow()
- func CursorUp(n int)
- func EraseLine(mode EraseLineMode)
- func NewAnsiStderr() io.Writer
- func NewAnsiStdout() io.Writer
- func Print(a ...interface{}) (n int, err error)
- func Printf(format string, a ...interface{}) (n int, err error)
- func Println(a ...interface{}) (n int, err error)
- type Coord
- type EraseLineMode
- type RuneReader
- type Short
Constants ¶
View Source
const ( KeyArrowLeft = '\x02' KeyArrowRight = '\x06' KeyArrowUp = '\x10' KeyArrowDown = '\x0e' KeySpace = ' ' KeyEnter = '\r' KeyBackspace = '\b' KeyDelete = '\x7f' KeyInterrupt = '\x03' KeyEndTransmission = '\x04' )
Variables ¶
View Source
var (
Stdout = NewAnsiStdout()
)
Functions ¶
func CursorHorizontalAbsolute ¶
func CursorHorizontalAbsolute(x int)
CursorHorizontalAbsolute moves cursor horizontally to x.
func CursorMove ¶ added in v1.2.0
CursorMove moves the cursor to a specific x,y location.
func CursorNextLine ¶
func CursorNextLine(n int)
CursorNextLine moves cursor to beginning of the line n lines down.
func CursorPreviousLine ¶
func CursorPreviousLine(n int)
CursorPreviousLine moves cursor to beginning of the line n lines up.
func EraseLine ¶ added in v1.0.1
func EraseLine(mode EraseLineMode)
func NewAnsiStderr ¶
Returns special stderr, which converts escape sequences to Windows API calls on Windows environment.
func NewAnsiStdout ¶
Returns special stdout, which converts escape sequences to Windows API calls on Windows environment.
Types ¶
type Coord ¶ added in v1.2.0
func CursorLocation ¶ added in v1.2.0
CursorLocation returns the current location of the cursor in the terminal
type EraseLineMode ¶ added in v1.0.1
type EraseLineMode int
const ( ERASE_LINE_END EraseLineMode = iota ERASE_LINE_START ERASE_LINE_ALL )
type RuneReader ¶ added in v1.1.1
func NewRuneReader ¶ added in v1.1.1
func NewRuneReader(input *os.File) *RuneReader
func (*RuneReader) ReadLine ¶ added in v1.1.1
func (rr *RuneReader) ReadLine(mask rune) ([]rune, error)
func (*RuneReader) RestoreTermMode ¶ added in v1.1.1
func (rr *RuneReader) RestoreTermMode() error
func (*RuneReader) SetTermMode ¶ added in v1.1.1
func (rr *RuneReader) SetTermMode() error
For reading runes we just want to disable echo.
Click to show internal directories.
Click to hide internal directories.