* somehow now the only thing that doesnt work is devices.Device Signed-off-by: Joe Kimmel <jkimmel@vmware.com> * this gets rid of all the compiler errors in the vendored code Signed-off-by: Joe Kimmel <jkimmel@vmware.com> * fixed some things but a bunch of tests and maybe some compiler steps are still failing Signed-off-by: Joe Kimmel <jkimmel@vmware.com> * all the things i figured out how to fix so far Signed-off-by: Joe Kimmel <jkimmel@vmware.com> * guess i had to redo go mods after rebasing again Signed-off-by: Joe Kimmel <jkimmel@vmware.com> * update docker constants to be SHOUTY CASE now Signed-off-by: Joe Kimmel <jkimmel@vmware.com> * include DestPath in resolveEnv Signed-off-by: Joe Kimmel <jkimmel@vmware.com> * fix one mistake in Docker lib upgrade and some typos/deprecations in the file Signed-off-by: Joe Kimmel <jkimmel@vmware.com> * last changes (hopefully) to update to new docker libs Signed-off-by: Joe Kimmel <jkimmel@vmware.com> --------- Signed-off-by: Joe Kimmel <jkimmel@vmware.com> |
||
|---|---|---|
| .. | ||
| windows | ||
| .gitignore | ||
| LICENSE | ||
| README.md | ||
| ascii.go | ||
| proxy.go | ||
| tc.go | ||
| term.go | ||
| term_windows.go | ||
| termios.go | ||
| termios_bsd.go | ||
| termios_nonbsd.go | ||
| winsize.go | ||
README.md
term - utilities for dealing with terminals
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.
Copyright and license
Code and documentation copyright 2015 Docker, inc. Code released under the Apache 2.0 license. Docs released under Creative commons.