MarcosAmbrose
Joined: 25 Sep 2006 Posts: 38 Location: Adelaide, Australia
|
Ansi escape code to hide the cursor |
Posted: Tue Oct 28, 2008 11:05 pm |
|
|
I'm trying to send an ANSI escape sequence to hide the cursor on my terminal so you don't see it dancing around the screen, but I just can't seem to get it to work. My other ANSI related functions seem to work ok. Anyone got any ideas? I've googled this one to death with no success.
Code: |
#define ON 1
#define OFF 0
void main()
{
ClrScr();
Cursor(OFF);
while(1)
{
printf("Print some stuff\r");
}
}
//// Clear the terminal screen ///
void ClrScr(void)
{
printf("\x1B[2J");
}
//TURN THE CURSOR ON/OFF ///
void Cursor(int1 IO)
{
if(IO)
{
printf("\x1B[?25h");
}
else
{
printf("\x1B[?25l");
}
}
|
|
|