spurious characters to stdout

John W. Eaton jwe at bevo.che.wisc.edu
Wed Mar 5 02:42:41 CST 2008


On  3-Mar-2008, Sepp Käsbauer wrote:

| Thank you John and Michael for your findings. 
| 
| But now i think we are at the core of the problem.
| If i run the follwing in a terminal:
| 
| echo "sin(3/4*pi)" | octave -q 
| ans =  0.70711
| 
| everything is perfect. 
| But if i redirect the output into a file e.g. i want the result of a 
| calculation in batch mode to be saved or be passed thru a pipe to the next 
| program then a get the esc-sequence which crashes the following command. 
| 
| echo "sin(3/4*pi)" | octave -q > out.dat
| vi out.dat
| ^[[?1034hans =  0.70711

The problem seems to be that readline is initialized even when Octave
is getting input from a pipe.  Due to the design of the command_editor
class I don't see an easy fix for this problem at the moment, though
it should be possible to ensure that the command_editor class does not
use readline if input is coming from a pipe.

jwe



More information about the Bug-octave mailing list