[英]How to get carriage return without line feed effect in Eclipse console?
如果我
System.out.print("something\r");
在控制台,我的光标回到行首,最后在
System.out.print("something\r");
System.out.print(" any\r");
我有
anything
打字。
但是在 Eclipse 控制台我得到
something
anything
好像它将\\r
视为 CR/LF。
我该如何设置?
该错误现已修复(Eclipse 2020-03)。 就去
Window ➺ Preferences ➺ Run/Debug ➺ Console
并确保两个复选框
Interpret ASCII control characters
和
Interpret Carriage Return (\r) as control character
已启用。
好像终于在火星上修好了!
Version: Mars Release (4.5.0)
Build id: 20150621-1200
Used Java: jre1.8.0_60
你的代码
public class Main {
public static void main(String[] args) {
System.out.print("something\r");
System.out.print(" any\r");
}
}
输出
anything
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.