Results 1 to 4 of 4

Thread: clear screen in UNIX

  1. #1

    Thread Starter
    Lively Member Crazy_bee's Avatar
    Join Date
    Jul 2001
    Location
    Fitchburg
    Posts
    90

    clear screen in UNIX

    how can I clear the screen on a UNIX platform in C?
    Don't ever Ginop before you Ginip

  2. #2
    If on Win32 it's system("cls"), perhaps it's system("clear") like on Linux?

  3. #3
    jim mcnamara
    Guest
    It depends on how the tty is defined. For X-sessions (like Linux or Exceed) it is like Filburt1 noted. For telnet sessions on ANSI-compliant terminals this works if executed from the host:
    Code:
    #include <stdio.h>
    #include <stdlib.h>
    void main(void){
       char esc = 27;
       printf("%c%s",esc,"[2J");
       printf("%c%s",esc,"[1;1H");
       return;
    NetTerm clears the screen by intertreting this stuff and then clears the data area of the PC Window. CRT does the same.

    For Wyse & DEC terminals this also works.

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    I'm sure there's something you can read under /etc that has all this information. top complains about terminal type when I run a remote session on it (it's on Solaris) via an SGI xwsh terminal (something about IRIS-ANSI-NET).
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width