Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
.github/workflows/ | H | 15-Sep-2020 | - | |||
windows/ | H | 15-Sep-2020 | - | |||
.gitignore | H A D | 15-Sep-2020 | 280 | |||
LICENSE | H A D | 15-Sep-2020 | 10.5 KiB | |||
README.md | H A D | 15-Sep-2020 | 1 KiB | |||
ascii.go | H A D | 15-Sep-2020 | 1 KiB | |||
ascii_test.go | H A D | 15-Sep-2020 | 567 | |||
go.mod | H A D | 15-Sep-2020 | 297 | |||
go.sum | H A D | 15-Sep-2020 | 2.1 KiB | |||
proxy.go | H A D | 15-Sep-2020 | 2.2 KiB | |||
proxy_test.go | H A D | 15-Sep-2020 | 5.9 KiB | |||
tc.go | H A D | 15-Sep-2020 | 321 | |||
term.go | H A D | 15-Sep-2020 | 3 KiB | |||
term_test.go | H A D | 15-Sep-2020 | 2.7 KiB | |||
term_windows.go | H A D | 15-Sep-2020 | 6.8 KiB | |||
termios.go | H A D | 15-Sep-2020 | 916 | |||
termios_bsd.go | H A D | 15-Sep-2020 | 158 | |||
termios_nonbsd.go | H A D | 15-Sep-2020 | 166 | |||
winsize.go | H A D | 15-Sep-2020 | 635 |
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