<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to 586: GPVAL_INTERACTIVE</title><link href="https://sourceforge.net/p/gnuplot/feature-requests/586/" rel="alternate"/><link href="https://sourceforge.net/p/gnuplot/feature-requests/586/feed.atom" rel="self"/><id>https://sourceforge.net/p/gnuplot/feature-requests/586/</id><updated>2025-05-01T16:14:03.558000Z</updated><subtitle>Recent changes to 586: GPVAL_INTERACTIVE</subtitle><entry><title>#586 GPVAL_INTERACTIVE</title><link href="https://sourceforge.net/p/gnuplot/feature-requests/586/?limit=25#9c73" rel="alternate"/><published>2025-05-01T16:14:03.558000Z</published><updated>2025-05-01T16:14:03.558000Z</updated><author><name>Ethan Merritt</name><uri>https://sourceforge.net/u/sfeam/</uri></author><id>https://sourceforge.net2aab376261e340a2e81a30d1cc554fc5d289e535</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Please see comments attached to this support request:&lt;br/&gt;
&lt;a href="https://sourceforge.net/p/gnuplot/support-requests/300/"&gt;https://sourceforge.net/p/gnuplot/support-requests/300/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The word "interactive" means different things to different people, and to different programs.&lt;/p&gt;
&lt;p&gt;The gnuplot variable "interactive" is TRUE if the next command will be read from &lt;em&gt;stdin&lt;/em&gt;, FALSE if the next command will be read from some file handle other than &lt;em&gt;stdin&lt;/em&gt;.    This is probably not what a typical user would expect it to mean.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>GPVAL_INTERACTIVE</title><link href="https://sourceforge.net/p/gnuplot/feature-requests/586/" rel="alternate"/><published>2025-05-01T09:53:56.202000Z</published><updated>2025-05-01T09:53:56.202000Z</updated><author><name>Shigeharu TAKENO</name><uri>https://sourceforge.net/u/shige-takeno/</uri></author><id>https://sourceforge.net817c8c9e41e522432bcb1a562c25ac8c99902ce4</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I hope a variable GPVAL_INTERACTIVE which is TRUE if  the current gnuplot session is interactive.&lt;br/&gt;
This may be useful for gnuplot script for several terminals. For example:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="gh"&gt;#&lt;/span&gt;set term pngcairo size 640,400 
&lt;span class="gh"&gt;#&lt;/span&gt;set term webp size 640,400 animate delay 5 loop 1
&lt;span class="gh"&gt;#&lt;/span&gt;set output "test1.webp"
&lt;span class="gh"&gt;#&lt;/span&gt;set term gif size 640,400 animate delay 5 loop 1
&lt;span class="gh"&gt;#&lt;/span&gt;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
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Well, I added the code to src/eval.c:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="n"&gt;extern&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;TBOOLEAN&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;interactive&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;...&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;fill_gpval_integer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"GPVAL_INTERACTIVE"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;interactive&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ow"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;update_gpval_variables&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;but the value GPVAL_INTERACTIVE may not be set correctly.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>