|
-
Dec 6th, 2001, 02:55 PM
#1
Thread Starter
Lively Member
clear screen in UNIX
how can I clear the screen on a UNIX platform in C?
Don't ever Ginop before you Ginip 
-
Dec 6th, 2001, 03:17 PM
#2
Member
If on Win32 it's system("cls"), perhaps it's system("clear") like on Linux?
-
Dec 6th, 2001, 05:00 PM
#3
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.
-
Dec 9th, 2001, 08:17 AM
#4
Monday Morning Lunatic
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|