// SaveState saves the state of the given console func SaveState(fd uintptr) (*State, error) { mode, e := winconsole.GetConsoleMode(fd) if e != nil { return nil, e } return &State{mode}, nil }
// IsTerminal returns true if the given file descriptor is a terminal. func IsTerminal(fd uintptr) bool { _, e := winconsole.GetConsoleMode(fd) return e == nil }