08-01-2002
Quote:
Originally posted by killerserv
yes clrscr() works for me. I tried using curces.h
#include <curses.h>
void clrscr()
{
in the end of your code use
clear();
refresh();
}
Is there any compiler argument that has to been entered when compiling to invoke those funktions?
I only got a SEGfault with gcc.
clear(); does not clear the screen.
and I cant compile with refresh(); in the code.
I'm kind of new in c programming to so excuse my question.
But I'm learning
Thanks!
10 More Discussions You Might Find Interesting
1. Programming
I searched the post and someone said to clear the screen in C, use
printf("\033[2J"); ??
However, this doesn't work...typo or no.
What is an equivalent command to 'CLS' in DOS/'clear' in UNIX to clear the screen and go to top of screen??
Thank you. (2 Replies)
Discussion started by: giannicello
2 Replies
2. Programming
How do I clear screen in g++
I've included curses and tried compile with lcurses as per gcc but fails, I can clear by using system("clear") but would prefer to use the curses library if possible. (2 Replies)
Discussion started by: gefa
2 Replies
3. Shell Programming and Scripting
Hello guys,
I wonder if it is possible to clear out the screen in AWK.
I'm printing out mail messages and I would like every message starting on the beginning of the screen. When I use FOR loop and printf("\n") it clears out the screen but my text is somewhere in the middle of the screen.
... (2 Replies)
Discussion started by: petoSVK
2 Replies
4. Programming
hi ,
Could any one tell me the command for clearing the screen in GDB session (1 Reply)
Discussion started by: useless79
1 Replies
5. UNIX for Dummies Questions & Answers
Hi...
i have one doubt pls...
1)can we clear the command line history in UNIX for a paricular login(scadm/root)if so how?.
2) can we see the time at which command executed.
history is showing like :
100 display
101 lock
102 exit (7 Replies)
Discussion started by: gincemathew
7 Replies
6. OS X (Apple)
Hi,
I'm trying to create a virtual screen, (maybe xvfb? or any other virtual screen buffer) and be able to use Screen Sharing to connect to it.
The setup is that I have a Mac Mini connected to the TV. But when my girlfriend is using Front Row, I can't use Screen Sharing at the same time from... (0 Replies)
Discussion started by: linge
0 Replies
7. Shell Programming and Scripting
I am unable to use clear or cls command on bash shell. I have recently installed Cygwin and am using that for practicing unix commands.
I see that I can use Ctrl + L to clear the screen. I created an alias in my .bashrc to do the same as
alias cls='^L'
This is how i defined other aliases ... (4 Replies)
Discussion started by: erora
4 Replies
8. Red Hat
Hi,
I have a simple question : how to disable screen lock and/or sreen saver with command line with RHEL5.4 ? (1 Reply)
Discussion started by: albator1932
1 Replies
9. UNIX for Dummies Questions & Answers
I made a screen within a screen.
Is there a way to move the inner screen up one level so that it is at the same level as the first screen running from the shell? (2 Replies)
Discussion started by: phpchick
2 Replies
10. Shell Programming and Scripting
I want to clear specific part of the screen. Say for example , i am running a bash script
for i in {1..100}
do
echo "Current Record = $i"
done
if i use a clear command over there , it will clear my screen however when i scroll up i would have the old records , is there anyway in unix to... (5 Replies)
Discussion started by: chidori
5 Replies
LEARN ABOUT SUSE
clrtoeol
clear(3NCURSES) clear(3NCURSES)
NAME
erase, werase, clear, wclear, clrtobot, wclrtobot, clrtoeol, wclrtoeol - clear all or part of a curses window
SYNOPSIS
# include <curses.h>
int erase(void);
int werase(WINDOW *win);
int clear(void);
int wclear(WINDOW *win);
int clrtobot(void);
int wclrtobot(WINDOW *win);
int clrtoeol(void);
int wclrtoeol(WINDOW *win);
DESCRIPTION
The erase and werase routines copy blanks to every position in the window, clearing the screen.
The clear and wclear routines are like erase and werase, but they also call clearok, so that the screen is cleared completely on the next
call to wrefresh for that window and repainted from scratch.
The clrtobot and wclrtobot routines erase from the cursor to the end of screen. That is, they erase all lines below the cursor in the win-
dow. Also, the current line to the right of the cursor, inclusive, is erased.
The clrtoeol and wclrtoeol routines erase the current line to the right of the cursor, inclusive, to the end of the current line.
Blanks created by erasure have the current background rendition (as set by wbkgdset) merged into them.
RETURN VALUE
All routines return the integer OK on success and ERR on failure. The SVr4.0 manual says "or a non-negative integer if immedok is set",
but this appears to be an error.
X/Open defines no error conditions. In this implementation, functions using a window pointer parameter return an error if it is null.
NOTES
Note that erase, werase, clear, wclear, clrtobot, and clrtoeol may be macros.
PORTABILITY
These functions are described in the XSI Curses standard, Issue 4. The standard specifies that they return ERR on failure, but specifies
no error conditions.
Some historic curses implementations had, as an undocumented feature, the ability to do the equivalent of clearok(..., 1) by saying touch-
win(stdscr) or clear(stdscr). This will not work under ncurses.
This implementation, and others such as Solaris, sets the current position to 0,0 after erasing via werase() and wclear(). That fact is
not documented in other implementations, and may not be true of implementations which were not derived from SVr4 source.
Not obvious from the description, most implementations clear the screen after wclear even for a subwindow or derived window. If you do not
want to clear the screen during the next wrefresh, use werase instead.
SEE ALSO
ncurses(3NCURSES), outopts(3NCURSES), refresh(3NCURSES)
clear(3NCURSES)