CrazyMax 45e4550c36
vendor: update buildkit
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
..
windows vendor: update buildkit
.gitignore vendor: update buildkit with typed errors support
LICENSE vendor: update buildkit with typed errors support
README.md vendor: update buildkit with typed errors support
ascii.go vendor: update buildkit with typed errors support
go.mod vendor: update buildkit
go.sum vendor: update buildkit
proxy.go vendor: update buildkit with typed errors support
tc.go vendor: update buildkit to v0.8
term.go vendor: update buildkit with typed errors support
term_windows.go Update buildkit
termios.go vendor: update buildkit to v0.8
termios_bsd.go vendor: update buildkit with typed errors support
termios_nonbsd.go vendor: update buildkit with typed errors support
winsize.go vendor: update buildkit with typed errors support

README.md

term - utilities for dealing with terminals

Test GoDoc Go Report Card

term provides structures and helper functions to work with terminal (state, sizes).

Using term

package main

import (
	"log"
	"os"

	"github.com/moby/term"
)

func main() {
	fd := os.Stdin.Fd()
	if term.IsTerminal(fd) {
		ws, err := term.GetWinsize(fd)
		if err != nil {
			log.Fatalf("term.GetWinsize: %s", err)
		}
		log.Printf("%d:%d\n", ws.Height, ws.Width)
	}
}

Contributing

Want to hack on term? Docker's contributions guidelines apply.

Code and documentation copyright 2015 Docker, inc. Code released under the Apache 2.0 license. Docs released under Creative commons.