> > > > > gpcommands.WriteLine("splot x+y");
> > > > > gpcommands.WriteLine("bind Close \"exit gnuplot\"");
> >
> > Does this have anything to do with C# at all? Even interactively (4.6p0),
> > "bind Close exit" does not seem to work.
>
> No, everything is ok in interactive mode. At least the plot window does
> not freeze by hitting q. (I think you have to use bind Close "exit
> gnuplot" instead.)
> It works with linux, but with the same compiler for windows not. I would
> guess the problem is MS or gnuplot.
>
> Of course, the behavior of a pipe via C++ or C would be very
> interesting.
Okay, adding the gnuplot to "bind Close 'exit gnuplot'" makes it work
as expected.
In interactive mode, it works for me, as you described. I don't have a C#
compiler, but from gnuplot's point of view, there should be no difference
between what you're doing in C# to write to gnuplot's STDIN and:
echo bind Close 'exit gnuplot'; splot x+y; pause -1 | gnuplot.exe
And that works just fine for me. I can close the plot window with either
q or alt+F4 and I am returned to the command prompt.
If I add a print, e.g.:
echo bind Close 'exit gnuplot'; splot x+y; pause -1; print 'got this far' | gnuplot.exe
the print never happens, suggesting the binding is indeed working.
Even adding a "set terminal windows" does not change the behavior
(with alt+F4 since the windows terminal doesn't accept q to close).
I'm using a 64-bit OS (Windows 2003). I wouldn't expect that to matter,
as gnuplot is a 32-bit app regardless. I cannot duplicate what you're
seeing.
|