I've been tryna find an answer to this for a while but I'm a newbie with little hope left lol
In Java, I have two threads right now:
(main class) Thread A has a while loop listening to commands with Scanner.nextLine()
Thread B prints out "test" every second
When I start both threads, I can't properly type a command without it getting interrupted by Thread B's printing
Output:
test
test
commantest
dctest
ommandtest
test
test
How do I prevent this so I can type commands without any interruptions? I'm open to using ANSI Escape codes and JCurses (or any libraries reallyy) :)
Thanks!