|
From: Theo H. <th...@ph...> - 2005-07-18 15:51:01
|
Dmitri A. Sergatskov wrote: > Theo Hopman wrote: >> This is exactly the expected behaviour. gnuplot sees end of input from >> the pipe and quits. The x11 helper program gnuplot_x11 keeps running, >> as requested by -persist, but has nowhere to send the mouse events >> since gnuplot has finished. Hence, no mousing. > > OK, here is a better test (courtesy of John Eaton): > > mkfifo fifo1 > then in one xterm: > > gnuplot < fifo1 > > in another xterm: > > cat > fifo1 > set mouse > plot sin(x) > ... > > This works as expected on linux/x86, linux/ppc and is not working on > MacOSX/X11... (Tiger 10.4, kernel 8.2.0) I'm not sure what behaviour you're expecting, but for me this gives exactly the same results as with an unnamed pipe: there is a coordinate display, but zooming and the like are not available. I did mkfifo fifo1 gnuplot -persist < fifo1 & ps -u $USER cat << EOC > fifo1 set mouse plot sin(x) EOC ps -u $USER # note gnuplot is done but gnuplot_x11 is still running. Once again, gnuplot sees an end-of-input on the named pipe, and quits. To prevent this, you need shell trickery like the following: gnuplot <fifo1 3>fifo1 & File descriptor 3 of gnuplot is redirected to the named pipe. As long as gnuplot is running (and doesn't close file descriptor 3), it won't encounter an end-of-input on the named pipe, and won't quit. Since gnuplot is still running, mousing works. Do `echo "quit" > fifo1` or the like to make gnuplot quit. THeo (BTW: System is Fedora Core 3) |