/ttyname

Go equivalent for the tty command

Primary LanguageGo

ttyname

GoDoc

Prints the file name of the terminal connected to standard input.

Usage

tty, err := ttyname.TTY()
if err != nil {
	panic(err)
}

fmt.Println(tty)