podman/vendor/github.com/moby/term
Daniel J Walsh fc197fb4f5
[NO TESTS NEEDED] Vendor in containers/buildah v1.20.0
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-03-26 13:57:27 -04:00
..
windows [NO TESTS NEEDED] Vendor in containers/buildah v1.20.0 2021-03-26 13:57:27 -04:00
.gitignore update github.com/docker/docker and relevant deps 2020-09-18 02:22:25 +09:00
LICENSE update github.com/docker/docker and relevant deps 2020-09-18 02:22:25 +09:00
README.md update github.com/docker/docker and relevant deps 2020-09-18 02:22:25 +09:00
ascii.go update github.com/docker/docker and relevant deps 2020-09-18 02:22:25 +09:00
go.mod Bump to containers/buildah 1.9.2 2021-01-15 06:23:19 -05:00
go.sum Bump to containers/buildah 1.9.2 2021-01-15 06:23:19 -05:00
proxy.go update github.com/docker/docker and relevant deps 2020-09-18 02:22:25 +09:00
tc.go update github.com/docker/docker and relevant deps 2020-09-18 02:22:25 +09:00
term.go update github.com/docker/docker and relevant deps 2020-09-18 02:22:25 +09:00
term_windows.go Bump to containers/buildah 1.9.2 2021-01-15 06:23:19 -05:00
termios.go update github.com/docker/docker and relevant deps 2020-09-18 02:22:25 +09:00
termios_bsd.go update github.com/docker/docker and relevant deps 2020-09-18 02:22:25 +09:00
termios_nonbsd.go update github.com/docker/docker and relevant deps 2020-09-18 02:22:25 +09:00
winsize.go update github.com/docker/docker and relevant deps 2020-09-18 02:22:25 +09:00

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.