Don't quit ioloop on NUL character (#940)

* dont quit ioloop on 0 rune

* check for closed channel

* remove unused error on `Close()`
This commit is contained in:
Jeffrey Morgan
2023-10-27 20:01:48 -07:00
committed by GitHub
parent c0dcea1398
commit 4748609611
4 changed files with 38 additions and 37 deletions

View File

@@ -1,4 +1,6 @@
//go:build aix || darwin || dragonfly || freebsd || (linux && !appengine) || netbsd || openbsd || os400 || solaris
// +build aix darwin dragonfly freebsd linux,!appengine netbsd openbsd os400 solaris
package readline
import (
@@ -30,6 +32,6 @@ func UnsetRawMode(fd int, termios *Termios) error {
// IsTerminal returns true if the given file descriptor is a terminal.
func IsTerminal(fd int) bool {
_, err := getTermios(fd)
return err == nil
_, err := getTermios(fd)
return err == nil
}