fixed terminal clear on linux

This commit is contained in:
Egor 2022-02-22 00:35:55 +03:00
parent 5ffdb41147
commit 151bd5fa7b

View file

@ -58,8 +58,10 @@ public final class CommandLineHandler {
try { try {
if (System.getProperty("os.name").contains("Windows")) if (System.getProperty("os.name").contains("Windows"))
new ProcessBuilder("cmd", "/c", "cls").inheritIO().start().waitFor(); new ProcessBuilder("cmd", "/c", "cls").inheritIO().start().waitFor();
else else {
Runtime.getRuntime().exec("clear"); System.out.print("\033[H\033[2J");
System.out.flush();
}
} catch (IOException | InterruptedException e) { } catch (IOException | InterruptedException e) {
e.printStackTrace(); e.printStackTrace();
} }