spurious characters to stdout

Sepp Käsbauer cho-00047 at chiemgau-online.de
Mon Mar 3 09:46:54 CST 2008


Am Montag, 3. März 2008 schrieb John W. Eaton:
> | Am Freitag, 29. Februar 2008 schrieb John W. Eaton:
> | > On 29-Feb-2008, Sepp Käsbauer wrote:
> | > | Am Freitag, 29. Februar 2008 schrieb pieters:
> | > | > Octave prints 8 characters to stdout before any other output. Some
> | > | > of these characters are non-printable and I have seen any spurious
> | > | > characters during normal octave sessions. However, when I call an
> | > | > octave script from within another script and further  process the
> | > | > output to stdout, the 8 spurious characters show up. I always get
> | > | > the same sequence of characters, namely: <ESC>[?<US><RS>34h, where
> | > | > <ESC> is ASCII 27, <US> is ASCII 31, and <RS> is ASCII 30. I have
> | > | > observed the same sequence of characters with and without the
> | > | > welcome message (i.e., with and without the -q command-line
> | > | > option).
> | > | >
> | > | >
> | > | > Repeat-By:
> | > | > ---------
> | > | > When I call octave like so:
> | > | > echo exit|octave -q>output.txt,
> | > | > the 8 characters are in the output.txt file.
> | > |
> | > | I can confirm this behaviour.
> | > | It has nothing to do with octave. (here octave-3.0.0)
> | > | To have a litle workaround you have to unset $TERM like:
> | > |
> | > | $ TA=$TERM
> | > | $ export TERM=""
> | > | $ echo exit|octave -q>output.txt
> | > | $ export TERM=$TA
> | > |
> | > | In this case output.txt is empty.
> | >
> | > What is in TERM before you reset it to ""?
> |
> | xterm
> |
> | > What terminal application are you using?
> |
> | Konsole 1.6.6 (KDE 3.5.9  openSUSE 10.3)
> |
> | > What version of readline do you have?
> |
> | libreadline5-5.2-20
>
> On your system, does the output from
>
>   infocmp xterm
>
> contain the escape sequence that you see on the terminal when you
> start Octave?

infocmp xterm:
...
smm=\E[?1034h
...

If i assume that \E stands for ESC then i can confirm that smm is the same 
escape sequence i get in our case.
Google told me that it is used to activate color output in xterm. 

>
> I have to assume that the characters you see are coming from
> readline's initialization.  Octave certainly does not send character
> sequences like this, or manipulate the terminal directly using escape
> sequences.
>
> jwe
Sepp





More information about the Bug-octave mailing list