Skip to content

Latest commit

 

History

History
100 lines (70 loc) · 2.34 KB

README.md

File metadata and controls

100 lines (70 loc) · 2.34 KB

terminal-go

License: MIT

A Go library for working with ANSI/VT terminal sequences.

Installation

go get github.com/ankddev/terminal-go

Usage

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")
}

Features

  • Cursor movement and positioning
  • Text colors and attributes
  • Screen clearing and line manipulation
  • Scrolling and margins
  • Window manipulation
  • Character sets
  • And more...

Documentation

For detailed documentation of all available functions and constants, please see:

Building from Source

git clone https://github.com/ankddev/terminal-go.git
cd terminal-go
go build

Testing

To run tests:

go test -v

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

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

Author

ANKDDEV

See Also

Support

If you have any questions or suggestions, please open an issue on GitHub.