Path: utzoo!attcan!uunet!mcsun!hp4nl!ruuinf!ruunsa!demoel From: demoel@ruunsa.fys.ruu.nl (Ed de_Moel) Newsgroups: comp.lang.c Subject: Re: ANSI ESCAPE SEQUENCES Message-ID: <1746@ruunsa.fys.ruu.nl> Date: 12 Nov 90 08:00:32 GMT References: <102019@cc.utah.edu> Organization: University of Utrecht, Dept. of Physics Lines: 53 In <102019@cc.utah.edu> PRASAD@cc.utah.edu writes: >Hi > This is my first posting to this newsgroup >I wanted to know the ANSI screen control escape sequences >e.g >clear screen >position cursor >etc >thanks in advance >Prasad The ANSI standard for device control (not just CRT's but any output device!) exists since 1979. It really amazes me that UNIX people, unlike the rest of the world keep using non-standard (and hence non-portable) code using termcaps libraries. (Sorry, this was really aimed at a different letter in this group). Your escape-sequences are: Position cursor: [ y-coordinate ; x-coordinate H Clear screen: [ J The coordinate system for a CRT is: - left upper corner is [1;1H - right lower corner is [24;80H Note that cursor positioning and erasing are separate operations, so if you want to clear the screen and put the cursor in the upper left corner: [H[J (Hey: 1;1 is obviously default). The above codes are for 7-bit transmission, but will also work for 8-bit transmission. If you are using 8-bit transmission, you may abbreviate [ to . Note: = ASCII code 27 (decimal) 7-bit introducer 1st char ; = 27 + 32 parameter-separator [ = 27 + 64 7-bit introducer 2nd char = 27 + 128 8-bit introducer only char The complete text of ANSI X3-64/1979 can be obtained through your national normalization institute, which is probably ANSI in New York. Success ! Ed.