MinoMino / minterm

A small utility library for Go that helps manipulate the terminal.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

minterm

minterm

Just a small library to help manipulate the terminal in Go. I needed something like Python's shutil.get_terminal_size(), so I wrote this, then added some more stuff I ended up needing.

Usage

###Import

import "github.com/MinoMino/minterm"

###Terminal Size

columns, rows, err := minterm.TerminalSize()

###Line Reservation

lr, _ := NewLineReserver()
defer lr.Release()
lr.Set("This line will always be the last line.")
fmt.Println("You can now print normally.")

An example of it used in conjunction with minprogress: Image of line reservation in use with minprogress.

License

MIT. See LICENSE for details.

About

A small utility library for Go that helps manipulate the terminal.

License:MIT License


Languages

Language:Go 100.0%