[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference noted::hackers_v1

Title:-={ H A C K E R S }=-
Notice:Write locked - see NOTED::HACKERS
Moderator:DIEHRD::MORRIS
Created:Thu Feb 20 1986
Last Modified:Mon Aug 03 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:680
Total number of notes:5456

559.0. "Escape sequences - Can they be received by DCL?" by XANADU::COFFLER (Jeff Coffler) Fri Sep 18 1987 15:17

    How do you receive escape sequences from a VAX/VMS DCL routine?
    
    I've tried ... in 'normal' terminal mode, escape sequences that the
    terminal sends to the computer appear to be ignored on a DCL READ.  In
    PASTHRU mode, the escape sequence is returned, but VMS waits for the
    <CR> character before terminating the READ.  Thus, I can't get the
    escape sequence from the terminal without user intervention.
    
    Is there a way, from DCL, to receive a terminal report (or some
    other escape sequence) that a VT200 or VT300 may pass?  Excuse me
    if this has already been discussed ...
    
    	-- Jeff
T.RTitleUserPersonal
Name
DateLines
559.1UFP::MURPHYRick MurphyFri Sep 18 1987 22:0629
    This is off the top of my head; I know I've done something like
    this before, but you may have to play around a bit to get it to
    work.
    	-Rick
    $ ! Set the terminal /NOLINE and /NOESCAPE to inhibit escape processing.
    $ ! Set the terminal /NOECHO so the responses won't echo.
    $ ! Then, request the report twice. Perform several reads to get back
    $ ! The responses.
    $ ! I can't find a TT_ECHO item for GETDVI, so I'm assuming it's
    $ ! on..
    $ esc_mode = f$getdvi("SYS$COMMAND:","TT_ESCAPE")
    $ edit_mode = f$getdvi("SYS$COMMAND:","TT_EDITING")
    $ SET TERM/NOESCAPE/NOLINE_EDIT/NOECHO
    $ ESC[0,7]==27
    $ WRITE SYS$OUTPUT ESC,"Z",ESC,"Z"			! Request ident
    $ READ/PROMPT=""/TIME=1/ERROR=OK  SYS$COMMAND FOO	! Read the escape
    $OK:
    $ READ/PROMPT=""/TIME=1/ERROR=OK1 SYS$COMMAND RESPONSE
    $OK1:
    $ READ/PROMPT=""/TIME=1/ERROR=OK2  SYS$COMMAND FOO	! Read the escape
    $OK2:
    $ READ/PROMPT=""/TIME=1/ERROR=OK3  SYS$COMMAND FOO	! Second response
    $OK3:
    $ IF esc_mode THEN SET TERM/ESCAPE
    $ IF edit_mode THEN SET TERM/LINE_EDIT
    $ SET TERM/ECHO
    $ WRITE SYS$OUTPUT RESPONSE
    $ EXIT
    
559.2That works, thanksXANADU::COFFLERJeff CofflerMon Sep 21 1987 12:078
    re: .1
    
    Thanks, that seemed to do the trick.  Weird stuff, though, considering
    that VMS is bright enough to parse escape sequences.
    
    You will find a TT_NOECHO that you can use to check if /ECHO is set ...
    
    	-- Jeff