Help us shape the future of Go! Take the 2026 Go Developer Survey

tty

package
v1.3.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package tty says whether a file is a terminal and how large its screen is, on the systems that have a terminal to ask (the unix family and Windows); elsewhere a file is never a terminal and its size is not known.

A size is 0 for what is not known: a file that is not a terminal has none, and a terminal may report none. A caller that wants a size treats 0 as unknown.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsTerminal

func IsTerminal(f *os.File) bool

IsTerminal says whether f is a terminal. A character device alone is not (/dev/null is one too): the terminal is what answers for its window size.

func Size

func Size(f *os.File) (rows, cols int)

Size is the rows and columns of f's screen, each 0 when not known.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL