Skip to content

Commit

Permalink
fixes #480 EventError fired after suspended Screen resumes
Browse files Browse the repository at this point in the history
  • Loading branch information
gdamore committed Sep 4, 2021
1 parent 7c71e4f commit 01188f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion tscreen.go
Expand Up @@ -1547,7 +1547,12 @@ func (t *tScreen) inputLoop(stopQ chan struct{}) {
switch e {
case nil:
default:
_ = t.PostEvent(NewEventError(e))
t.Lock()
running := t.running
t.Unlock()
if running {
_ = t.PostEvent(NewEventError(e))
}
return
}
if n > 0 {
Expand Down
2 changes: 1 addition & 1 deletion tty_unix.go
Expand Up @@ -72,7 +72,7 @@ func (tty *devTty) Start() error {
if tty.f, err = os.OpenFile(tty.dev, os.O_RDWR, 0); err != nil {
return err
}
tty.fd = int(tty.of.Fd())
tty.fd = int(tty.f.Fd())

if !term.IsTerminal(tty.fd) {
return errors.New("device is not a terminal")
Expand Down

0 comments on commit 01188f4

Please sign in to comment.