• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.github/workflows/H15-Sep-2020-

windows/H15-Sep-2020-

.gitignoreH A D15-Sep-2020280

LICENSEH A D15-Sep-202010.5 KiB

README.mdH A D15-Sep-20201 KiB

ascii.goH A D15-Sep-20201 KiB

ascii_test.goH A D15-Sep-2020567

go.modH A D15-Sep-2020297

go.sumH A D15-Sep-20202.1 KiB

proxy.goH A D15-Sep-20202.2 KiB

proxy_test.goH A D15-Sep-20205.9 KiB

tc.goH A D15-Sep-2020321

term.goH A D15-Sep-20203 KiB

term_test.goH A D15-Sep-20202.7 KiB

term_windows.goH A D15-Sep-20206.8 KiB

termios.goH A D15-Sep-2020916

termios_bsd.goH A D15-Sep-2020158

termios_nonbsd.goH A D15-Sep-2020166

winsize.goH A D15-Sep-2020635

README.md

1# term - utilities for dealing with terminals
2
3![Test](https://github.com/moby/term/workflows/Test/badge.svg) [![GoDoc](https://godoc.org/github.com/moby/term?status.svg)](https://godoc.org/github.com/moby/term) [![Go Report Card](https://goreportcard.com/badge/github.com/moby/term)](https://goreportcard.com/report/github.com/moby/term)
4
5term provides structures and helper functions to work with terminal (state, sizes).
6
7#### Using term
8
9```go
10package main
11
12import (
13	"log"
14	"os"
15
16	"github.com/moby/term"
17)
18
19func main() {
20	fd := os.Stdin.Fd()
21	if term.IsTerminal(fd) {
22		ws, err := term.GetWinsize(fd)
23		if err != nil {
24			log.Fatalf("term.GetWinsize: %s", err)
25		}
26		log.Printf("%d:%d\n", ws.Height, ws.Width)
27	}
28}
29```
30
31## Contributing
32
33Want to hack on term? [Docker's contributions guidelines](https://github.com/docker/docker/blob/master/CONTRIBUTING.md) apply.
34
35## Copyright and license
36Code and documentation copyright 2015 Docker, inc. Code released under the Apache 2.0 license. Docs released under Creative commons.
37