Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/raklaptudirm/terminal
Simple terminal manipulation functions
https://github.com/raklaptudirm/terminal
ansi terminal xterm
Last synced: 20 days ago
JSON representation
Simple terminal manipulation functions
- Host: GitHub
- URL: https://github.com/raklaptudirm/terminal
- Owner: raklaptudirm
- License: apache-2.0
- Created: 2022-06-15T09:50:15.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-01-28T18:07:30.000Z (almost 2 years ago)
- Last Synced: 2024-12-05T22:05:15.126Z (about 1 month ago)
- Topics: ansi, terminal, xterm
- Language: Go
- Homepage: https://laptudirm.com/x/terminal
- Size: 21.5 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
terminal - Simple Terminal manipulation methods
terminal implements various functions for doing sophisticated terminal
manipulation, including cursor movement, screen erasing, and others.### Installation
```
go get -u laptudirm.com/x/terminal
```### Examples
```go
import (
"os"
"laptudirm.com/x/terminal"
)// create an *terminal.Terminal from os.Stdout
term := terminal.New(os.Stdout)// various terminal manipulation functions
term.EraseScreen()
term.HideCursor()
term.MoveCursorHome()// all the fmt functions are also defined
term.Print("Hello, ")
term.Println("World!")
term.Printf("PI: %d", 3.1415)
```### Documentation
The documentation and a comprehensive list of all the manipulation functions
can be found at https://laptudirm.com/x/terminal.### References
- https://en.wikipedia.org/wiki/ANSI_escape_code
- https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797