From: MERC::"uunet!CRVAX.SRI.COM!RELAY-INFO-VAX" 10-MAY-1992 21:51:50.89 To: info-vax@kl.sri.com CC: Subj: Re: Clearing screens in VMS. In article <93BWFT!3X@linac.fnal.gov>, lauri@elwing.fnal.gov (Lauri Loebel) writes: > In article <2050@ais.com>, bruce@ais.com writes: >> [stuff deleted] >> $ _so_[0,8] == 14 >> $ _si_[0,8] == 15 >> $ _esc_[0,8] == 27 >> $ _clear_screen_ == _esc_+"[$}"+_esc_+"(B"+_si_+_esc_+"[r"+_esc_+"[m"+ - >> _esc_+"[H"+_esc_+"[J" >> $ cls :== write sys$output _clear_screen_ >> >> The ESC "[r" will set the terminal's scrolling region to be the entire >> screen regardless of its size > > Ok, I give. I can recognize what some of these escape sequences are > doing, but I've never seen others. Can you describe the "[$}" and the > "(B" and the _si_? (I think the others have been covered in this thread > already)... (And is there any significance to the _so_?) VT300's and VT400's have an extra line that can be used as a status line. It is logically a separate "virtual screen", it isn't scrolled or cleared with the rest of the screen. The attributes on it are also separate (that is, the cursor position and current video mode are separate for the main screen and the status line, so you can jump back and forth between the main screen and the status line just by sending an escape sequence to select which display you want to write to, and when you write to the display it will pick up where it left off on that virtual screen). The ESC "[$}" sequence selects the main screen (as opposed to the status line). You can send ESC "[1$}" to write to the status line (the terminal has to be set to "host writable status line" for this to work, though you can force the status line to be host-writable by sending ESC "[2$~"). ESC "(B" selects US ASCII as the G0 character set, and the SI selects G0 as the GL character set. GL (left-hand code page) is the set that is used for character codes hex 20 through hex 7f, GR (right-hand code page) is the set that is used for character codes hex a0 through hex ff. Note that the VT terminals don't display characters for codes hex 00 through hex 1f, and for codes hex 80 through hex 9f, unless they are in "display controls" mode which can only be set or cleared from the terminal itself. There can be up to 4 character sets selected into G0 through G3, and these can in turn be selected into GL and GR as required. Other common character sets are things like the right-hand code page for ISO Latin-1 (accented characters and various additional symbols and punctuation), the DEC multinational set (which is somewhat similar to Latin-1), the special graphics set (line drawing characters and other odds and ends), and the technical set (mostly mathematical characters). The Latin-1 and DEC multinational sets are most often used by putting them into GR, so that you can get to them without an extra escape sequence. The special graphics set is most often used in GL, usually either by selecting it into G0 (done with an ESC "(0" sequence), or by selecting it into G1 (done with an ESC ")0" sequence) and then selecting G1 into GL by sending an SO. Either way all the lower case letters turn into corners and crossed lines and such :). (In fact on the VT100 proper there was no support for GR at all, the only way to get the special graphics characters was to map them to GL somehow). Those two sequences - ESC "(B" and SI - make sure that the character sets are mapped in at least a slightly rational fashion. None of those other character sets is very useful if it gets selected into GL while you're at the DCL prompt ... The "SO" character definition was included into the article from my login file (I just clipped everything in that section into the article), and is not used in the clear screen sequence itself. The previous paragraph explains what SO is used for ... it's just not used in that particular string that I'm constructing. Bruce C. Wright