2017-01-20 22:34 GMT+01:00 Johannes Waldmann <johannes.waldmann@htwk-leipzig.de>:
I am trying to use  gloss https://hackage.haskell.org/package/gloss from ghci. The "display" command will open a  indow and draw the picture on it just fine.

But when I close this window by hitting ESC, ghci  prints   <interactive>: interrupted and exits, so I'm back at the shell from where I started ghci. [...]

This is caused by:

https://github.com/benl23x5/gloss/blob/277a89ec539471ad1f82ed1086ae4fdf55b4e81b/gloss/Graphics/Gloss/Internals/Interface/Backend/GLUT.hs#L51

GLUT's actionOnWindowClose *does* work, at least it does nowadays, the line in question is from 2011. I've just tested my HSuperBible7 package under ghci, and you can start/stop/restart the examples from the prompt. The relevant lines:

https://github.com/svenpanne/HSuperBible7/blob/7e298a5d3cbfa5f739847a538b875aac7a634ee1/src/SB7/SB7/Application.hs#L124
 https://github.com/svenpanne/HSuperBible7/blob/7e298a5d3cbfa5f739847a538b875aac7a634ee1/src/SB7/SB7/Application.hs#L201

I think this is worth a ticket in the gloss project...

Cheers,
   S.