tty_windows.go

 1//go:build windows
 2// +build windows
 3
 4package uv
 5
 6import "os"
 7
 8func openTTY() (inTty, outTty *os.File, err error) {
 9	// On Windows, when the input/output is redirected or piped, we need to
10	// open the console explicitly.
11	// See https://learn.microsoft.com/en-us/windows/console/getstdhandle#remarks
12	inTty, err = os.OpenFile("CONIN$", os.O_RDWR, 0o644) //nolint:gosec
13	if err != nil {
14		return nil, nil, err
15	}
16	outTty, err = os.OpenFile("CONOUT$", os.O_RDWR, 0o644) //nolint:gosec
17	if err != nil {
18		return nil, nil, err
19	}
20	return inTty, outTty, nil
21}
22
23func suspend() (err error) {
24	// On Windows, suspending the process group is not supported in the same
25	// way as Unix-like systems.
26	return nil
27}