java - How do I clear the screen using Jansi? -


i trying clear console in java using jansi. using macos, jansi should portable.

here code have tried:

ansiconsole.systeminstall();  system.out.println("hello... "); system.out.println(ansi.ansi().erasescreen()); system.out.println("... world."); 

however, not clear screen. inserts many new lines , prints next line, this:

hello...        ... world.  

how clear screen properly, final output below?

... world.  


Comments