karmada/vendor/github.com/moby/term
RainbowMango c2de90bb5e Bump Kubernetes dependencies to v1.31.2
Bump controller-runtime to v0.19.1

Signed-off-by: RainbowMango <qdurenhongcai@gmail.com>
2024-11-12 17:52:36 +08:00
..
windows Bump Kubernetes dependencies to v1.31.2 2024-11-12 17:52:36 +08:00
.gitignore change vendor 2021-10-12 17:09:52 +08:00
LICENSE change vendor 2021-10-12 17:09:52 +08:00
README.md change vendor 2021-10-12 17:09:52 +08:00
ascii.go change vendor 2021-10-12 17:09:52 +08:00
doc.go Bump Kubernetes dependencies to v1.31.2 2024-11-12 17:52:36 +08:00
proxy.go change vendor 2021-10-12 17:09:52 +08:00
term.go Bump Kubernetes dependencies to v1.31.2 2024-11-12 17:52:36 +08:00
term_unix.go Bump Kubernetes dependencies to v1.31.2 2024-11-12 17:52:36 +08:00
term_windows.go Bump Kubernetes dependencies to v1.31.2 2024-11-12 17:52:36 +08:00
termios_bsd.go Update vendor 2023-07-29 16:47:38 +08:00
termios_nonbsd.go Update vendor 2023-07-29 16:47:38 +08:00
termios_unix.go Bump Kubernetes dependencies to v1.31.2 2024-11-12 17:52:36 +08:00
termios_windows.go Bump Kubernetes dependencies to v1.31.2 2024-11-12 17:52:36 +08: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.