From:	SMTP%"RELAY-INFO-VAX@CRVAX.SRI.COM" 19-MAY-1993 20:45:36.40
To:	EVERHART
CC:	
Subj:	RE: terminal video mode

Date:    Wed, 19 May 1993 23:54:16 +0200
From:    "GWDGV1::MOELLER" <moeller@gwdgv1.dnet.gwdg.de>
To:      shiao@STSCI.EDU,
         info-vax@sri.com
Cc:      GWDGI::"info-vax@sri.com",MOELLER
Subject: RE: terminal video mode

<shiao@STSCI.EDU> asks:
> I have a problem with an errant application, (not one of ours), upon
> exiting the application it modifies the current video attributes
> to reverse video. [...]
>     Is is possible to find out what the current video mode is? [...]

If your terminal is at least a VT3xx (to make sure, check TT_DECCRT3
via f$getdvi(), after $SET TERM/INQUIRE), the following DCL code
will normally set the symbol `bg_white' to a logical value
corresponding to "white background":

-----
$ bg_white = 0		! provide default (dark background) just in case
$ esc[0,8] = 27
$ query = esc + "[?5$p"				! VT300 inquiry "decrqm".
$ set term/noecho
$ read/time=2/err=badrpm SYS$COMMAND dummy/prompt=&query
$ read/time=2/err=badrpm SYS$COMMAND decrpm/prompt=&query
$ read/time=1/err=crt_ok1 SYS$COMMAND dummy/prompt="" ! clear typeahead
$crt_ok1:
$ i = f$locate("?5;",decrpm)
$ if i.ge.f$length(decrpm) then goto badrpm
$ if f$ext(i+4,2,decrpm).nes."$y" then goto badrpm
$ i = f$extract(i+3,1,decrpm)
$ if f$type(i).nes."INTEGER" then goto badrpm
$!
$ bg_white = i.and.1				! successful query
$!
$badrpm:	! come here on any error
$ set term/echo
-----

Wolfgang J. Moeller, GWDG, D-3400 Goettingen, F.R.Germany | Disclaimer ...
PSI%(0262)45050352008::MOELLER      Phone: +49 551 201516 | No claim intended!
Internet: moeller@gwdgv1.dnet.gwdg.de   | This space intentionally left blank.

