mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-11-11 01:28:19 +03:00
Handle EINTR in IsTerminal
This commit is contained in:
parent
10cef16210
commit
67f03621ae
@ -20,12 +20,6 @@ const (
|
||||
TCSAFLUSH = 2
|
||||
)
|
||||
|
||||
func IsTerminal(fd uintptr) bool {
|
||||
var t unix.Termios
|
||||
err := Tcgetattr(int(fd), &t)
|
||||
return err == nil
|
||||
}
|
||||
|
||||
type Term struct {
|
||||
name string
|
||||
fd int
|
||||
@ -52,6 +46,12 @@ func eintr_retry_intret(f func() (int, error)) (int, error) {
|
||||
}
|
||||
}
|
||||
|
||||
func IsTerminal(fd uintptr) bool {
|
||||
var t unix.Termios
|
||||
err := eintr_retry_noret(func() error { return Tcgetattr(int(fd), &t) })
|
||||
return err == nil
|
||||
}
|
||||
|
||||
type TermiosOperation func(t *unix.Termios)
|
||||
|
||||
func get_vmin_and_vtime(d time.Duration) (uint8, uint8) {
|
||||
|
Loading…
Reference in New Issue
Block a user