Skip to content

Instantly share code, notes, and snippets.

@Dimanaux
Created October 12, 2017 13:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dimanaux/045df5289e7d2c3a34e12bf889756f69 to your computer and use it in GitHub Desktop.
Save Dimanaux/045df5289e7d2c3a34e12bf889756f69 to your computer and use it in GitHub Desktop.
How to clear screen (terminal)
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