develooper Front page | perl.perl5.porters | Postings from March 2000

$PERL_VERSION triggers vt100 answerback sequence!!

Tom Christiansen
March 18, 2000 15:58
$PERL_VERSION triggers vt100 answerback sequence!!
Message ID:
Well, I've just spent a happy time murdering spurious xterms that
Perl has, through some indirection, been launching for me. 

Um, watch this:

    % cd bleadperl 
    % ./perl -Ilib -MEnglish -e 'print $PERL_VERSION' | cat -v

It was even worse with _67:

    % perl5.5.670 -MEnglish -e 'print $PERL_VERSION' | cat -v

From p13 of the "Digital VT100 User Guide":

    "Answerback is a question and answer sequence where the host
    computer asks the terminal to identify itself. The VT100
    answerback feature provides the terminal with the capability
    to identify itself by sending a message to the host. [...]

    The answerback message may also be transmitted by typing CTRL-BREAK."

A CTRL-E, that is, chr(5), is the ASCII ENQ control character.
This is very unhappy.  When you print it out, your vt100 tells you
what it "really" is.  

Now, eventually this will start to get better for people
on xterms.

	Patch #101 - 1999/5/10 - XFree86 3.9Pm
	    change default answerback response to an empty string.

Without this patch, each ^E punch "xterm" *into your input buffer*.
That means it appears to your shell (or to whoever is reading your
input stream) that you've just typed that.  Or whatever your terminal
self-identifies as.  And you can't assume the xterm hack.  All the
world isn't an xterm, let alone up to date.

I don't have a suggestion.  But.... can this really right?

I further note:

    % ./perl -Ilib -MEnglish -e 'printf "%d\n", $PERL_VERSION' | cat -v
    % ./perl -Ilib -MEnglish -e 'printf "%f\n", $PERL_VERSION' | cat -v
    % ./perl -Ilib -MEnglish -e 'printf "%c\n", $PERL_VERSION' | cat -v
    % ./perl -Ilib -MEnglish -e 'printf "%.1s\n", $PERL_VERSION' | cat -v

I've never seen something in Perl before where a %c and a %.1s can 
print the same thing.

--tom Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About