A Go library for working with ANSI/VT terminal sequences.
go get github.com/ankddev/terminal-go
package main
import (
"fmt"
term "github.com/ankddev/terminal-go"
)
func main() {
// Move cursor to position (5,10)
fmt.Print(term.CursorPosition(5, 10))
// Set text color to red
fmt.Print(term.SetTextColor(1))
fmt.Println("This text is red")
// Reset all attributes
fmt.Print(term.ResetAllAttributes)
// Clear screen
fmt.Print(term.EraseInDisplay)
// Save cursor position
fmt.Print(term.SaveCursorPosition)
// Move cursor and restore position
fmt.Print(term.CursorForward(10))
fmt.Println("This text is red")
}
- Cursor movement and positioning
- Text colors and attributes
- Screen clearing and line manipulation
- Scrolling and margins
- Window manipulation
- Character sets
- And more...
For detailed documentation of all available functions and constants, please see:
git clone https://github.com/ankddev/terminal-go.git
cd terminal-go
go build
To run tests:
go test -v
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
ANKDDEV
- codewars-api-rs - Rust library for Codewars API
- conemu-progressbar-go - Progress bar for ConEmu for Go
- envfetch - Lightweight crossplatform CLI tool for working with environment variables
- zapret-discord-youtube - Zapret build for Windows for fixing Discord and YouTube in Russia or othher services
If you have any questions or suggestions, please open an issue on GitHub.