ide-haskell-repl icon indicating copy to clipboard operation
ide-haskell-repl copied to clipboard

Interactive main getting stuck

Open freeman42x opened this issue 3 years ago • 1 comments

When loading this into repl https://github.com/puffnfresh/fp-course/blob/twitch/projects/TicTacToe/Main.hs and running main the repl seems to break and does not output anything:

image

Plugin was configured to use stack repl. Using stack repl it works fine:

image

If I click Interrupt current computation I get:

image

Process crashed while running request

stderr:
stdout:
...
...
...
request:
:{
main
:}
Hide Stack Trace
TypeError: Cannot read property 'stderr' of undefined
    at Object.promiseGenerator (C:\Users\freeman42x\.atom\packages\ide-haskell-repl\lib\interactive-process.js:13[0]():46)

I also want to use this oportunity to thank you for creating this extension. The reload on file save and re-run last command is a super useful feature which I have not seen in any other extension/repl's. Having syntax highlighting and autocomplete is also something rare or maybe even unique.

freeman42x avatar Feb 21 '22 06:02 freeman42x

There's a bit of a trick to it, you need to explicitly include a newline in your input if your program expects a newline, e.g.

P1<enter><shift+enter> (<shift-enter> is "execute", i.e. send the input to the repl)

The reason it's like this is because of getChar etc. Not very intuitive, I admit, probably there's a better option.

lierdakil avatar Mar 04 '22 09:03 lierdakil