Skip to content

tcellansi converts tcell styles to ANSI escape sequences, enabling styled terminal output with ease

License

Notifications You must be signed in to change notification settings

noborus/tcellansi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tcellansi

Go Reference

tcellansi is a package for converting tcell styles to ANSI escape sequences.

Installation

To install the package, run:

go get github.com/noborus/tcellansi

Usage

Here is a simple example of how to use tcellansi:

package main

import (
	"github.com/gdamore/tcell/v2"
	"github.com/noborus/tcellansi"
)

func main() {
	// Initialize tcell screen
	screen, _ := tcell.NewScreen()
	screen.Init()

	// Create a style
	style := tcell.StyleDefault.Foreground(tcell.ColorRed).Background(tcell.ColorBlack)

	// Convert the style to ANSI escape sequence
	ansiSeq := tcellansi.ToAnsi(style)
	screen.Fini()

	println(ansiSeq + "Hello world!")
}

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

tcellansi converts tcell styles to ANSI escape sequences, enabling styled terminal output with ease

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages