Clearing the terminal
Hi,
·
I remember reading somewhere that one can print certain control characters that will clear the terminal screen, this using the System.out.print() statement. Needless to say I looked all over but cannot find those characters. Can anyone point me in the right direction?
·
·
Thanks,
·
Enrique
·
I remember reading somewhere that one can print certain control characters that will clear the terminal screen, this using the System.out.print() statement. Needless to say I looked all over but cannot find those characters. Can anyone point me in the right direction?
·
·
Thanks,
·
Enrique
Comments
· public static final int JIDE_HOME··· = 1;· //move cursor to upper-left position (home)
· public static final int JIDE_LEFT··· = 3;· //move cursor one position to left
· public static final int JIDE_RIGHT·· = 4;· //move cursor one position to right
· public static final int JIDE_UP····· = 5;· //move cursor one line up
· public static final int JIDE_DOWN··· = 6;· //move cursor one line down
· public static final int JIDE_BELL··· = 7;· //sound bell
· public static final int JIDE_BS····· = 8;· //delete character to left of cursor and move cursor left
· public static final int JIDE_TAB···· = 9;· //appears to be ignored by IDE message window
· public static final int JIDE_NEWLINE = 10; //move cursor to start of next line
· public static final int JIDE_CR····· = 13; //appears to be ignored by IDE message window
· public static final int JIDE_CLS···· = 16; //clear message window and home cursor
regards peter
System.out.print(“\16”[noparse];)[/noparse];
but the terminal is not cleared
Enrique
System.out.print('\u0010');
to clear the screen (remember, you need to send a character, not a number or string).
Or use System.out.print((char)JIDE_CLS);
regards peter
Thanks