X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f996b,f38da49bcb89bc62,start X-Google-Attributes: gidf996b,public X-Google-ArrivalTime: 1994-03-28 05:04:19 PST Newsgroups: alt.ascii-art Path: gmd.de!newsserver.jvnc.net!netnews.upenn.edu!msuinfo!agate!howland.reston.ans.net!math.ohio-state.edu!sdd.hp.com!think.com!spdcc!merk!winston From: winston@merk.com (Winston Smith) Subject: Re: Commands for cat Message-ID: Keywords: VT100, Digital, DEC, ANSI, CAT Organization: Technology Partners, Inc. References: <2n1f66$t3r@mojo.eng.umd.edu> Date: Mon, 28 Mar 1994 13:04:19 GMT Lines: 52 On Saturday, March 26, 1994 at 14:00:38 GMT (9:00 am EST ?) leggsc@eng.umd.edu (Michael Casinghino) writes: MC> This is usually followed by some sort of code like " #6 " or " [2j " or MC> " [6;17f ". I could easily write a program to interpret these codes if I MC> knew what they meant, but none of my newbie (baby?) Unix books hold the MC> answers. Does anyone have the key? (Or even better, the program I'm MC> trying to write.) The reason you will find no answer in a UNIX book is because... This is --NOT-- a UNIX problem. This is a --TERMINAL-- problem. ...specifically, the Digital Equipment Corp. (a.k.a. DEC) VT100 ANSI. To quote from my handy-dandy DEC VT52 / DEC VT100 manual: Change this line to double-width, single height ESC # 6 Erase entire screen ESC [ 2 J HVP Horizontal and Vertical Position ESC [ ; f Moves the active position to the position specified by the parameters (i.e. the two numbers used). This sequence has two parameter values, the first specifying the line position (i.e. relative row) and the second specifying the column. A parameter value of either zero or one causes the active position to move to the first line or column in the display, respectively (i.e. 0,0 and 1,1 are both the top left corner). The default condition with no parameters present moves the active position to the home position (i.e. using NO numbers also means the top left corner usually, or the top of the active scrolling region). In the VT100, this control behaves identically with its editor function counterpart, CUP. The numbering of lines and columns depends on the reset or set state of the origin mode (DECOM) format effector. For reference: CUP Cursor Position ESC [ ; H DECOM Origin Mode (DEC Private) Initiated via RESET. All this mess o' text means is that " ESC [ # ; # f " is identical to " ESC [ # ; # H " for the VT100 unless a scrolling region has been declared and changed the top margin space. (Usually the scrolling region is the --ENTIRE-- screen). The fact that your system uses UNIX is irrelevant. The problem would be the same had your system used VAX VMS/DCL or VM CMS/REXX. The system is writing DEC VT100 terminal codes (i.e. the reason for the ".VT" file suffix). You need VT100 emulation such as is provided on an IBM clone via a VT100.SYS device driver or a program that emulates a VT100, such as PROCOMM. Try to find a VT100 manual or a DEC terminal reference to refer to, or an ANSI reference that includes the native DEC codes as well as the more general ANSI codes. Good luck.