Path: utzoo!attcan!uunet!mcvax!hp4nl!botter!star.cs.vu.nl!maart From: maart@cs.vu.nl (Maarten Litmaath) Newsgroups: comp.unix.questions Subject: Re: clearing the terminal screen Keywords: setenv clear vt100 Message-ID: <1817@solo10.cs.vu.nl> Date: 15 Dec 88 21:39:43 GMT References: <7007@batcomputer.tn.cornell.edu> Distribution: comp Organization: V.U. Informatica, Amsterdam, the Netherlands Lines: 39 lynch@batcomputer.tn.cornell.edu (Tim Lynch) writes: \I'm having a problem setting an environmental variable to speed up \screen clearing. If I'm working from a hp terminal the following works: \ % setenv CLEAR `clear` \ % echo $CLEAR # (and the screen is cleared) \But, if I'm working from a vt100, issuing echo $CLEAR does nothing. \Furthermore, echo $CLEAR | wc shows that CLEAR is of length zero. \The terminfo for the vt100 appears ok because I can issue: \ % clear The escape code clearing a VT100 screen, contains some magic characters: ^[[;H^[[2J (^[ = escape) The magic characters are `[', `;' and another `['. The `[' character is used to match filenames, like: % echo *.[ch] # echo all C source + include files The escape code above doesn't contain a corresponding ']', so csh should have said: Missing ]. (Of course if csh's syntax/parser were right, it wouldn't have parsed the output of the backquote command at all.) It's a bug indeed; there's no standard output, because the backquote command ultimately fails, and csh simply forgets to issue an error message (on stderr). Solution: % setenv CLEAR "`clear`" % echo "$CLEAR" # you'll want to put this in an alias -- fcntl(fd, F_SETFL, FNDELAY): |Maarten Litmaath @ VU Amsterdam: let's go weepin' in the corner! |maart@cs.vu.nl, mcvax!botter!maart