moby--moby/vendor/github.com/moby/term
Sebastiaan van Stijn 4ab96db4ab
vendor: github.com/moby/term 7f0af18e79f2784809e9cef63d0df5aa2c79d76e
full diff: 73f35e472e...7f0af18e79

- update gotest.tools to v3
- Use unix.Ioctl{Get,Set}Termios on all unix platforms
- Make Termios type alias, remove casts

vendor: golang.org/x/sys 196b9ba8737a10c9253b04174f25881e562da5b8

full diff: ed371f2e16...196b9ba873

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-09-15 16:12:46 +02:00
..
windows
LICENSE
README.md
ascii.go
go.mod vendor: github.com/moby/term 7f0af18e79f2784809e9cef63d0df5aa2c79d76e 2020-09-15 16:12:46 +02:00
proxy.go
tc.go vendor: github.com/moby/term 7f0af18e79f2784809e9cef63d0df5aa2c79d76e 2020-09-15 16:12:46 +02:00
term.go vendor: github.com/moby/term 7f0af18e79f2784809e9cef63d0df5aa2c79d76e 2020-09-15 16:12:46 +02:00
term_windows.go
termios.go vendor: github.com/moby/term 7f0af18e79f2784809e9cef63d0df5aa2c79d76e 2020-09-15 16:12:46 +02:00
termios_bsd.go vendor: github.com/moby/term 7f0af18e79f2784809e9cef63d0df5aa2c79d76e 2020-09-15 16:12:46 +02:00
termios_nonbsd.go vendor: github.com/moby/term 7f0af18e79f2784809e9cef63d0df5aa2c79d76e 2020-09-15 16:12:46 +02:00
winsize.go

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.