diff --git a/tscreen_unix.go b/tscreen_unix.go index 53fcb9d..725785c 100644 --- a/tscreen_unix.go +++ b/tscreen_unix.go @@ -103,11 +103,14 @@ func (t *tScreen) disengage() { func (t *tScreen) initialize() error { var err error t.out = os.Stdout - t.in = os.Stdin - t.saved, err = term.GetState(int(os.Stdin.Fd())) - if err != nil { + if t.in, err = os.Open("/dev/tty"); err != nil { return err } + + t.saved, err = term.GetState(int(t.in.Fd())) + if err == nil { + return nil + } return nil }