open-vault/vendor/github.com/moby/term
Michael Golowka cc7efd393d
MySQL - Fix username generation length bug (#10433)
2020-12-01 15:24:51 -07:00
..
windows MySQL - Fix username generation length bug (#10433) 2020-12-01 15:24:51 -07:00
.gitignore MySQL - Fix username generation length bug (#10433) 2020-12-01 15:24:51 -07:00
LICENSE MySQL - Fix username generation length bug (#10433) 2020-12-01 15:24:51 -07:00
README.md MySQL - Fix username generation length bug (#10433) 2020-12-01 15:24:51 -07:00
ascii.go MySQL - Fix username generation length bug (#10433) 2020-12-01 15:24:51 -07:00
go.mod MySQL - Fix username generation length bug (#10433) 2020-12-01 15:24:51 -07:00
go.sum MySQL - Fix username generation length bug (#10433) 2020-12-01 15:24:51 -07:00
proxy.go MySQL - Fix username generation length bug (#10433) 2020-12-01 15:24:51 -07:00
tc.go MySQL - Fix username generation length bug (#10433) 2020-12-01 15:24:51 -07:00
term.go MySQL - Fix username generation length bug (#10433) 2020-12-01 15:24:51 -07:00
term_windows.go MySQL - Fix username generation length bug (#10433) 2020-12-01 15:24:51 -07:00
termios.go MySQL - Fix username generation length bug (#10433) 2020-12-01 15:24:51 -07:00
termios_bsd.go MySQL - Fix username generation length bug (#10433) 2020-12-01 15:24:51 -07:00
termios_nonbsd.go MySQL - Fix username generation length bug (#10433) 2020-12-01 15:24:51 -07:00
winsize.go MySQL - Fix username generation length bug (#10433) 2020-12-01 15:24:51 -07: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.