1
0
mirror of https://github.com/openshift/source-to-image.git synced 2026-02-05 21:44:56 +01:00
Files
2025-05-23 15:56:40 +05:30
..
2023-07-02 00:47:01 -04:00
2023-07-02 00:47:01 -04:00
2022-06-29 15:51:47 -04:00
2023-07-02 00:47:01 -04:00
2023-07-02 00:47:01 -04:00
2023-07-02 00:47:01 -04:00
2023-07-02 00:47:01 -04:00
2023-07-02 00:47:01 -04:00
2023-07-02 00:47:01 -04:00

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.