1// Copyright 2019 The Go Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style 3// license that can be found in the LICENSE file. 4 5package term 6 7import ( 8 "golang.org/x/sys/unix" 9) 10 11func isTerminal(fd int) bool { 12 _, err := unix.IoctlGetTermio(fd, unix.TCGETA) 13 return err == nil 14} 15