func/vendor/github.com/moby/term
Matej Vasek 5948cf4a07
Update docker client dependency (#1877)
* chore: update docker client lib

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* fixup: "host" OCI pusher

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* fixup: downgrade github.com/containers/image/v5

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* fixup: platform tests

Signed-off-by: Matej Vasek <mvasek@redhat.com>

---------

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-07-20 10:50:12 +00:00
..
windows Update docker client dependency (#1877) 2023-07-20 10:50:12 +00:00
.gitignore Vendor dependencies (#531) 2021-09-16 04:42:39 -07:00
LICENSE Vendor dependencies (#531) 2021-09-16 04:42:39 -07:00
README.md Vendor dependencies (#531) 2021-09-16 04:42:39 -07:00
ascii.go Vendor dependencies (#531) 2021-09-16 04:42:39 -07:00
doc.go Update docker client dependency (#1877) 2023-07-20 10:50:12 +00:00
proxy.go Vendor dependencies (#531) 2021-09-16 04:42:39 -07:00
term.go Update docker client dependency (#1877) 2023-07-20 10:50:12 +00:00
term_unix.go Update docker client dependency (#1877) 2023-07-20 10:50:12 +00:00
term_windows.go Update docker client dependency (#1877) 2023-07-20 10:50:12 +00:00
termios_bsd.go chore: update pack (#1506) 2023-01-19 07:08:00 +00:00
termios_nonbsd.go chore: update pack (#1506) 2023-01-19 07:08:00 +00:00
termios_unix.go Update docker client dependency (#1877) 2023-07-20 10:50:12 +00:00
termios_windows.go Update docker client dependency (#1877) 2023-07-20 10:50:12 +00: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.