gnuplot problem in ghci

Hello, I've used the gnuplot package http://hackage.haskell.org/package/gnuplot before with great satisfaction. Now I have a new computer (a Lenovo T400 with ubuntu 9.10) and I have a problem. After I make a plot in ghci, using a command such as plotFunc [] [0.0,0.1..10.0] cos shown below, the keyboard no longer echos my input to ghci. ghci will still do what I ask, as in computing 3+4 below, but I could not see the "3+4" until after I hit return. This is gnuplot 0.3.4. Could anyone suggest an idea? Thanks, Scott walck@walck-nsf:~/courses/phy261/code$ gnuplot --version gnuplot 4.2 patchlevel 5 walck@walck-nsf:~/courses/phy261/code$ ghci GHCi, version 6.12.1: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Loading package ffi-1.0 ... linking ... done. Prelude> :m +Graphics.Gnuplot.Simple Prelude Graphics.Gnuplot.Simple> plotFunc [] [0.0,0.1..10.0] cos Loading package syb-0.1.0.2 ... linking ... done. Loading package base-3.0.3.2 ... linking ... done. Loading package array-0.3.0.0 ... linking ... done. Loading package containers-0.3.0.0 ... linking ... done. Loading package monoid-transformer-0.0.2 ... linking ... done. Loading package old-locale-1.0.0.2 ... linking ... done. Loading package filepath-1.1.0.3 ... linking ... done. Loading package old-time-1.0.0.3 ... linking ... done. Loading package unix-2.4.0.0 ... linking ... done. Loading package directory-1.0.1.0 ... linking ... done. Loading package process-1.0.1.2 ... linking ... done. Loading package time-1.1.4 ... linking ... done. Loading package utility-ht-0.0.5.1 ... linking ... done. Loading package gnuplot-0.3.4 ... linking ... done. Prelude Graphics.Gnuplot.Simple> 3+4 7 Prelude Graphics.Gnuplot.Simple> -- Scott N. Walck Associate Professor of Physics Lebanon Valley College Annville, PA 17003 phone: 717-867-6153 fax: 717-867-6075 email: walck@lvc.edu

On Friday 14 May 2010 19:48:20, Scott N. Walck wrote:
Hello,
I've used the gnuplot package
http://hackage.haskell.org/package/gnuplot
before with great satisfaction. Now I have a new computer (a Lenovo T400 with ubuntu 9.10) and I have a problem. After I make a plot in ghci, using a command such as
plotFunc [] [0.0,0.1..10.0] cos
shown below, the keyboard no longer echos my input to ghci. ghci will still do what I ask, as in computing 3+4 below, but I could not see the "3+4" until after I hit return.
This is gnuplot 0.3.4.
Can't reproduce, ghc-6.12.2, gnuplot-0.3.4, $ gnuplot --version gnuplot 4.2 patchlevel 3 openSUSE 11.1
Could anyone suggest an idea?
Sorry, no. Though it looks like a buffering problem.
Thanks,
Scott

On May 14, 2010, at 14:21 , Daniel Fischer wrote:
On Friday 14 May 2010 19:48:20, Scott N. Walck wrote:
shown below, the keyboard no longer echos my input to ghci. ghci will still do what I ask, as in computing 3+4 below, but I could not see the "3+4" until after I hit return.
This is gnuplot 0.3.4. Could anyone suggest an idea?
Sorry, no. Though it looks like a buffering problem.
To me it sounds like the terminal's been reset to line mode. Type "tty" to the shell before starting ghci (it will output something like /dev/pts/3 or /dev/ttys003 or /dev/ptyp3), then when the problem happens switch to another terminal and type "stty -a

Brandon, Yes, that looks like what is happening. Here are before and after a graphics command. $ stty -a
On May 14, 2010, at 14:21 , Daniel Fischer wrote:
On Friday 14 May 2010 19:48:20, Scott N. Walck wrote:
shown below, the keyboard no longer echos my input to ghci. ghci will still do what I ask, as in computing 3+4 below, but I could not see the "3+4" until after I hit return.
This is gnuplot 0.3.4. Could anyone suggest an idea?
Sorry, no. Though it looks like a buffering problem.
To me it sounds like the terminal's been reset to line mode. Type "tty" to the shell before starting ghci (it will output something like /dev/pts/3 or /dev/ttys003 or /dev/ptyp3), then when the problem happens switch to another terminal and type "stty -a
This won't help you solve it but at least gives you some information to put in the bug report.
-- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH
-- Scott N. Walck Associate Professor of Physics Lebanon Valley College Annville, PA 17003 phone: 717-867-6153 fax: 717-867-6075 email: walck@lvc.edu

On May 14, 2010, at 19:16 , Scott N. Walck wrote:
Yes, that looks like what is happening. Here are before and after a graphics command.
So a workaround would be that after running a graphics command, run stty -icanon ") to fix the terminal settings. Not much of a handy workaround, sadly. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH
participants (3)
-
Brandon S. Allbery KF8NH
-
Daniel Fischer
-
Scott N. Walck