Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #27616

Re: terminal designed for C

From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: terminal designed for C
Date 2012-10-23 19:56 -0700
Organization None to speak of
Message-ID <lnvce0var5.fsf@nuthaus.mib.org> (permalink)
References <90bcf5bb-f8e9-4ea2-9cbe-82110bfd059c@googlegroups.com> <BfFhs.25$WP2.12@newsfe20.iad>

Show all headers | View raw


Lew Pitcher <lpitcher@teksavvy.com> writes:
[...]
> 3) On most ASCII-based terminals, the ASCII "form feed" (FF) character will
> clear the screen.
[...]

That doesn't seem to be the case.

I haven't used an ASCII-based *terminal*, as opposed to a terminal
emulator, in years.  But most terminal emulators, and probably
most actual terminals, are VT-100 compatible -- and a form feed
character, as far as I can tell, doesn't clear the screen.  In the
several emulators I've tried, it either does nothing or moves the
cursor down one line.

A working clear-screen sequence is "^[[H^[[2J", where "^[" denotes the
ASCII Escape character.

The comp.lang.c FAQ <http://www.c-faq.com/>, in question 19.4, says that
form-feed "will cause some displays to clear".

(Incidentally, a commonly suggested portable solution is to print enough
newlines to scroll everything of the top of the display.  Drawbacks of
this approach are: (1) it's hard to tell how many newlines are needed;
(2) the cursor is left at the bottom of the screen, and (3) text can
still be seen by scrolling up, which is a problem if you want to erase
sensitive information.)

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
    Will write code for food.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

terminal designed for C kerravon <kerravon@w3.to> - 2012-10-22 21:19 -0700
  Re: terminal designed for C Robert Wessel <robertwessel2@yahoo.com> - 2012-10-22 23:34 -0500
    Re: terminal designed for C kerravon <kerravon@w3.to> - 2012-10-22 21:56 -0700
  Re: terminal designed for C Sjouke Burry <s@b> - 2012-10-23 14:42 +0000
    Re: terminal designed for C Keith Thompson <kst-u@mib.org> - 2012-10-23 13:06 -0700
      Re: terminal designed for C kerravon <kerravon@w3.to> - 2012-10-23 15:46 -0700
        Re: terminal designed for C Eric Sosman <esosman@comcast-dot-net.invalid> - 2012-10-23 20:29 -0400
          Re: terminal designed for C Lew Pitcher <lpitcher@teksavvy.com> - 2012-10-23 21:26 -0400
          Re: terminal designed for C kerravon <kerravon@w3.to> - 2012-10-24 02:59 -0700
            Re: terminal designed for C Eric Sosman <esosman@comcast-dot-net.invalid> - 2012-10-24 14:15 -0400
            Re: terminal designed for C Lew Pitcher <lpitcher@teksavvy.com> - 2012-10-24 17:23 -0400
  Re: terminal designed for C Lew Pitcher <lpitcher@teksavvy.com> - 2012-10-23 18:55 -0400
    Re: terminal designed for C Keith Thompson <kst-u@mib.org> - 2012-10-23 19:56 -0700
    Re: terminal designed for C kerravon <kerravon@w3.to> - 2012-10-24 16:10 -0700
      Re: terminal designed for C Eric Sosman <esosman@comcast-dot-net.invalid> - 2012-10-24 20:15 -0400
      Re: terminal designed for C Lew Pitcher <lpitcher@teksavvy.com> - 2012-10-24 21:13 -0400
        Re: terminal designed for C kerravon <kerravon@w3.to> - 2012-10-24 21:09 -0700
          Re: terminal designed for C "BartC" <bc@freeuk.com> - 2012-10-25 11:29 +0100
            Re: terminal designed for C kerravon <kerravon@w3.to> - 2012-10-25 03:51 -0700
          Re: terminal designed for C James Kuyper <jameskuyper@verizon.net> - 2012-10-25 08:49 -0400
          Re: terminal designed for C Eric Sosman <esosman@comcast-dot-net.invalid> - 2012-10-25 09:04 -0400
            Re: terminal designed for C kerravon <kerravon@w3.to> - 2012-10-25 14:11 -0700
              Re: terminal designed for C Eric Sosman <esosman@comcast-dot-net.invalid> - 2012-10-25 17:29 -0400
                Re: terminal designed for C kerravon <kerravon@w3.to> - 2012-10-26 03:33 -0700
                Re: terminal designed for C Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-10-26 12:35 +0100
                Re: terminal designed for C kerravon <kerravon@w3.to> - 2012-10-26 15:46 -0700
                Re: terminal designed for C Keith Thompson <kst-u@mib.org> - 2012-10-26 17:11 -0700
                Re: terminal designed for C kerravon <kerravon@w3.to> - 2012-10-26 17:27 -0700
                Re: terminal designed for C Ian Collins <ian-news@hotmail.com> - 2012-10-27 13:39 +1300
                Re: terminal designed for C kerravon <kerravon@w3.to> - 2012-10-26 18:30 -0700
                Re: terminal designed for C James Kuyper <jameskuyper@verizon.net> - 2012-10-26 22:50 -0400
                Re: terminal designed for C Keith Thompson <kst-u@mib.org> - 2012-10-27 01:42 -0700
                Re: terminal designed for C James Kuyper <jameskuyper@verizon.net> - 2012-10-27 19:18 -0400
                Re: terminal designed for C Tim Rentsch <txr@alumni.caltech.edu> - 2012-12-17 10:48 -0800
                Re: terminal designed for C Keith Thompson <kst-u@mib.org> - 2012-12-17 12:27 -0800
                Re: terminal designed for C James Kuyper <jameskuyper@verizon.net> - 2012-12-17 15:51 -0500
                Re: terminal designed for C Keith Thompson <kst-u@mib.org> - 2012-12-17 13:35 -0800
                Re: terminal designed for C James Kuyper <jameskuyper@verizon.net> - 2012-12-17 16:48 -0500
                Re: terminal designed for C Robert Wessel <robertwessel2@yahoo.com> - 2012-12-17 14:53 -0600
                Re: terminal designed for C Keith Thompson <kst-u@mib.org> - 2012-12-17 13:20 -0800
                Re: terminal designed for C Tim Rentsch <txr@alumni.caltech.edu> - 2012-12-20 10:19 -0800
                Re: terminal designed for C Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-10-27 02:35 +0100
                Re: terminal designed for C kerravon <kerravon@w3.to> - 2012-10-26 18:58 -0700
                Re: terminal designed for C Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-10-27 05:01 +0100
                Re: terminal designed for C Robert Wessel <robertwessel2@yahoo.com> - 2012-10-27 00:56 -0500
                Re: terminal designed for C James Kuyper <jameskuyper@verizon.net> - 2012-10-26 09:03 -0400
                Re: terminal designed for C Keith Thompson <kst-u@mib.org> - 2012-10-26 11:13 -0700
                Re: terminal designed for C kerravon <kerravon@w3.to> - 2012-10-26 15:15 -0700
            Re: terminal designed for C lawrence.jones@siemens.com - 2012-11-12 18:08 -0500
  Re: terminal designed for C falk@rahul.net (Edward A. Falk) - 2012-10-24 17:29 +0000
  Re: terminal designed for C Keith Thompson <kst-u@mib.org> - 2012-10-24 11:55 -0700

csiph-web