Minimal working example:
import
Graphics.EasyPlot
plot X11 sin
On my system, as expected, a plot of the sine function appears in a window, GHCi displays True
(the value of the IO Bool
that plot
returned, indicating a successful plot) and a fresh command prompt appears.
Unexpectedly, when I type, no text appears at the command prompt until I hit enter. Then the text I typed becomes visible, and GHCi reacts as expected to whatever command I entered. When I type at the next command prompt, the same thing happens. So far, I've found two ways to get GHCi back to normal:
:l
to load a file.Why does this happen, and how can I prevent it?
Things that don't prevent the behavior:
plot
from the main
function in a file and running it using the :main
command in GHCi.PNG
terminal, instead of to a window.plot'
instead of plot
.Things that don't get GHCi back to normal:
:m
to unload all modules.I can reproduce what you describe (ghc-7.8.4, fedora 21, x86_64, xmonad).
It is not a ghci feature, you get the same behaviour in a shell.
gnuplot -e "set terminal x11 persist ; plot sin(x)"
(This is (roughly) the command that is sent to the shell by EasyPlot, cf. https://hackage.haskell.org/package/easyplot-1.0/docs/src/Graphics-EasyPlot.html#exec )
Plot window appears, shell prompt appears, but shell does not (seem to) work.
You can just move the mouse pointer to the plot window, then back to the shell - this seems to make it work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With