Overwriting text on terminal with Java, issue with Console.read*

前端 未结 1 1553
失恋的感觉
失恋的感觉 2021-01-29 04:12

I know there are hundreds of questions asking how to update already written text on console and I know I can do it printing the \\r character.

My issue comes when I use

相关标签:
1条回答
  • 2021-01-29 04:43

    In principle, this is terminal dependent, and with simple Java means there is no way to do this for all consoles.

    Many terminals (at least in unixoid systems) support ANSI-escape sequences, so you can there write something like "\u001B[1;5H" to move the cursor to line 1, columnn 5.

    0 讨论(0)
提交回复
热议问题