I hope a variable GPVAL_INTERACTIVE which is TRUE if the current gnuplot session is interactive.
This may be useful for gnuplot script for several terminals. For example:
#set term pngcairo size 640,400
#set term webp size 640,400 animate delay 5 loop 1
#set output "test1.webp"
#set term gif size 640,400 animate delay 5 loop 1
#set output "test1.gif"
set term wxt size 640,400
do for [i=1:10] {
if (GPVAL_TERM eq "pngcairo") {
set output sprintf("test1-%03d.png", i)
}
plot [0:10][-2:2] sin(x+i) w l not
if (GPVAL_INTERACTIVE) {
pause 0.5
}
}
Well, I added the code to src/eval.c:
extern TBOOLEAN interactive:
...
fill_gpval_integer("GPVAL_INTERACTIVE", interactive);
/* in update_gpval_variables() */
but the value GPVAL_INTERACTIVE may not be set correctly.
Please see comments attached to this support request:
https://sourceforge.net/p/gnuplot/support-requests/300/
The word "interactive" means different things to different people, and to different programs.
The gnuplot variable "interactive" is TRUE if the next command will be read from stdin, FALSE if the next command will be read from some file handle other than stdin. This is probably not what a typical user would expect it to mean.