handle race condition while setting raw mode in windows (#2509)

This commit is contained in:
Patrick Devine
2024-02-14 21:28:35 -08:00
committed by GitHub
parent 9241a29336
commit 42e77e2a69
5 changed files with 38 additions and 15 deletions

View File

@@ -25,8 +25,9 @@ func SetRawMode(fd int) (*Termios, error) {
return termios, setTermios(fd, &newTermios)
}
func UnsetRawMode(fd int, termios *Termios) error {
return setTermios(fd, termios)
func UnsetRawMode(fd int, termios any) error {
t := termios.(*Termios)
return setTermios(fd, t)
}
// IsTerminal returns true if the given file descriptor is a terminal.