Skip to content

Simple Go library for integration with terminal using sequences

License

Notifications You must be signed in to change notification settings

ankddev/terminal-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Simple Go library for integration with terminal using sequences

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages