I'm using the
godoc.org/code.google.com/p/go.crypto/ssh/terminal package to do some terminal stuff in Windows, and randomly when calling MakeRaw it fails with "The handle is invalid.".
Here's the code I'm using that fails:
termState, err := terminal.MakeRaw(int(os.Stdin.Fd()))
if err != nil {
log.Fatalln(err)
}
And another example of the same error, but using the GetConsoleMode WinAPI routine:
err := syscall.GetConsoleMode(syscall.Stdin, &mode)
if err != nil {
log.Fatalln(err)
}
Is there any reason this would fail with the "The handle is invalid." error?