Closed
Description
Just use the example from purescript-node-readline
repo:
module Main where
import Prelude
import Effect (Effect)
import Effect.Console (log)
import Node.EventEmitter (on_)
import Node.ReadLine (close, createConsoleInterface, lineH, noCompletion, prompt, setPrompt)
main :: Effect Unit
main = do
interface <- createConsoleInterface noCompletion
setPrompt "(type 'quit' to stop)\n> " interface
prompt interface
interface # on_ lineH \s ->
if s == "quit" then close interface
else do
log $ "You typed: " <> s
prompt interface
If spago bundle
then node index.js
, after typing quit the app terminates. But if spago run
directly, it hangs. It terminates only after pressing ctrl-d
. With spago run --verbose
, it can be deduced that the hang must have happened here: src/Spago/Cmd.purs#L59.
This happened with spago
version 0.93.9
. I also checkout out this repo and built a fresh version from head. It also happened there.