File: color_windows.go

package info (click to toggle)
golang-github-powerman-check 1.8.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 276 kB
  • sloc: sh: 15; makefile: 2
file content (15 lines) | stat: -rw-r--r-- 215 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//go:build windows
// +build windows

package check

import (
	"os"
	"syscall"
)

func isTerminal() bool {
	var mode uint32
	err := syscall.GetConsoleMode(syscall.Handle(os.Stdout.Fd()), &mode)
	return err == nil
}