Created
October 12, 2017 13:01
-
-
Save Dimanaux/045df5289e7d2c3a34e12bf889756f69 to your computer and use it in GitHub Desktop.
How to clear screen (terminal)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class InputHandler { | |
// clears the screen | |
public static void clearScreen() { | |
final String ANSI_CLS = "\u001b[2J"; | |
final String ANSI_HOME = "\u001b[H"; | |
System.out.print(ANSI_CLS + ANSI_HOME); | |
System.out.flush(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment