Skip to content

Commit

Permalink
RemGlk: pause stdin until the event handlers can be attached
Browse files Browse the repository at this point in the history
  • Loading branch information
curiousdannii committed Mar 15, 2024
1 parent 0b5ba05 commit 40b5636
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/glkote/remglk/remglk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export default class RemGlk extends GlkOte.GlkOteBase implements GlkOte.GlkOte {
this.stdin = process.stdin
this.stdout = process.stdout

// Pause stdin because with `init` being an async function the data event handler won't be attached in time to catch the init event
this.stdin.pause()
if (this.stdin.isTTY) {
this.stdin.setRawMode(true)
}
Expand Down Expand Up @@ -64,6 +66,7 @@ export default class RemGlk extends GlkOte.GlkOteBase implements GlkOte.GlkOte {
}
}
})
this.stdin.resume()

this.is_inited = true
}
Expand Down

0 comments on commit 40b5636

Please sign in to comment.