octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [interpeter] prompt does not appear after output of error or warning


From: Mike Miller
Subject: Re: [interpeter] prompt does not appear after output of error or warning of external program
Date: Sun, 18 Sep 2016 10:18:45 -0700
User-agent: NeoMutt/20160910 (1.7.0)

On Sun, Sep 18, 2016 at 14:31:43 +0900, Tatsuro MATSUOKA wrote:
> Hello
> 
> I do know judge whether what I want to point out is intentional. 
> 
> Octave uses external program (gnuplot) via pipe.
> Gnuplot or its external libraries sometimes send call back messages
> (error messages or warning.)
> 
> For example,
> 
> 
> >> graphics_toolkit gnuplot
> >> setenv GNUTERM wxt
> >> plot (rand(5))
> >>
> (gnuplot.exe:6116): Pango-WARNING **: couldn't load font "Helvetica 
> Not-Rotated 2
> 00", falling back to "Sans Not-Rotated 200", expect ugly output.
> 
> 
> After output the message, the octave command prompt does not appear.
> If I press ENTER, the command prompt appear.
> 
> On gnuplot
>  
> gnuplot> set term wxt font 'Helvetica'
> Terminal type set to 'wxt'
> Options are '0 enhanced font "Helvetica"'
> gnuplot> plot x
> 
> (gnuplot.exe:5072): Pango-WARNING **: couldn't load font "Helvetica 
> Not-Rotated 200", falling back to "Sans Not-Rotated 200", expect ugly output.
> gnuplot>
> 
> After warning from pango, gnuplot command prompt "gnuplot>" appear 
> immediately.
> 
> Is the octave behaviors for output from gnuplot intentional?

Yes, sort of?

The desired behavior is that gnuplot prints no warnings or output other
than the figure. Octave does nothing to hide or capture the stderr
stream, so if gnuplot does produce errors or warnings, it will appear on
the console output.

As your demo shows, the next prompt has already been printed before the
warning message comes from gnuplot. From Octave's point of view, the
gnuplot command has already finished and it is waiting for the next
command from you. If gnuplot prints a warning message after that point,
Octave doesn't know about it.

The same happens if I run

  system ("gnome-terminal", [], "async");

Octave prints the next command prompt, and then a few dozen warning
messages are printed from the gnome-terminal process.

-- 
mike



reply via email to

[Prev in Thread] Current Thread [Next in Thread]