k3s/vendor/github.com/moby/term
Brad Davidson e8381db778 Update Kubernetes to v1.21.0
* Update Kubernetes to v1.21.0
* Update to golang v1.16.2
* Update dependent modules to track with upstream
* Switch to upstream flannel
* Track changes to upstream cloud-controller-manager and FeatureGates

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2021-04-14 14:51:42 -07:00
..
windows Update Kubernetes to v1.21.0 2021-04-14 14:51:42 -07:00
.gitignore Update Kubernetes to v1.21.0 2021-04-14 14:51:42 -07:00
ascii.go Update Kubernetes to v1.21.0 2021-04-14 14:51:42 -07:00
go.mod Update Kubernetes to v1.21.0 2021-04-14 14:51:42 -07:00
go.sum Update Kubernetes to v1.21.0 2021-04-14 14:51:42 -07:00
LICENSE Update go.mod for k8s 1.19 2020-08-28 17:18:31 -07:00
proxy.go Update Kubernetes to v1.21.0 2021-04-14 14:51:42 -07:00
README.md Update Kubernetes to v1.21.0 2021-04-14 14:51:42 -07:00
tc.go Update Kubernetes to v1.21.0 2021-04-14 14:51:42 -07:00
term_windows.go Update Kubernetes to v1.21.0 2021-04-14 14:51:42 -07:00
term.go Update Kubernetes to v1.21.0 2021-04-14 14:51:42 -07:00
termios_bsd.go Update Kubernetes to v1.21.0 2021-04-14 14:51:42 -07:00
termios_nonbsd.go Update Kubernetes to v1.21.0 2021-04-14 14:51:42 -07:00
termios.go Update Kubernetes to v1.21.0 2021-04-14 14:51:42 -07:00
winsize.go Update Kubernetes to v1.21.0 2021-04-14 14:51:42 -07:00

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.