ptgoetz / go-ansi

ANSI color/style/cursor library for golang

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Go-ANSI

Go-ANSI is an ANSI color, style, and cursor manipulation library for golang.

Go Report Card GoDoc reference example GitHub go.mod Go version of a Go module

Rationale

There are a number of golang libraries for dealing with ANSI TTY terminals, but most seem to be too narrowly focused. For example, there are a number of libraries that focus primarily on TTY color, but ignore styles and cursor navigation. Others overly abstract away, and block access to, the lower level ANSI code API.

Existing Golang ANSI Libraries

Proposal

An OSS, liberally licensed (ASL v2), golang library that supports ANSI TTY color, style, and cursor navigation would benefit the golang community by providing a (potentially) commonly used utility.

It should provide:

  • A low-level, simple API for dealing with low-level things such as ANSI constants, and functions related to color, style, and cursor navigation. Higher-level components can use this API to create components or widgets such as progress indicators, colorized loggers, etc.
  • TTY detection. Provide an API for determining if the output is a an ANSI TTY, and if not, automatically disable ANSI formatting.
  • Higher-level, reusable components/widgets such as colorized loggers, CLI applications, etc.
  • Plenty of examples for developers to learn from and extend.

Resources

http://rrbrandt.dee.ufcg.edu.br/en/docs/ansi/cursor

About

ANSI color/style/cursor library for golang

License:Apache License 2.0


Languages

Language:Go 99.0%Language:Makefile 0.7%Language:Shell 0.3%