If I
System.out.print("something\r");
at console, I have cursor back at the beginning of line, and finally after
System.out.print("something\r");
System.out.print(" any\r");
I have
anything
typed.
But at Eclipse console I get
something
anything
as if it treated \r
as CR/LF.
How can I setup this?
It can be changed by going to Windows --> Preferences --> Run/Debug --> Console and then unchecking "Limit Console Output" which is ON by default. This works on STS any version too. This would help printing complete console output. For a Mac it is Eclipse > Preferences > Run/Debug > Console.
A line feed means moving one line forward. The code is \n . A carriage return means moving the cursor to the beginning of the line.
Just open the Window(in eclipse IDE) -> click on Reset Perspective. It worked for me.
As Nishant already pointed out in the comments, you've found a bug here.
This bug initially was reported in 2004 (>9 years ago!?!!) and this bug seems not to be fixed very soon (or ever). I tested it on several Eclipse version, even on Eclipse Juno SR2, and the bug is still there.
The bug is fixed by now (Eclipse 2020-03). Just go to
Window ➺ Preferences ➺ Run/Debug ➺ Console
and make sure that both checkboxes
Interpret ASCII control characters
and
Interpret Carriage Return (\r) as control character
are enabled.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With