This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 270729

Summary: Carriage return (\r, 0x0D) in output window moves output to new line (unnecessary Maven download progress lines in log)
Product: platform Reporter: bugmenot1
Component: Output WindowAssignee: Jaroslav Havlin <jhavlin>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: Dev   
Hardware: PC   
OS: Windows 10 x64   
Issue Type: DEFECT Exception Reporter:

Description bugmenot1 2017-05-24 10:26:08 UTC
After \r (without \n), output should overwrite the output in the last line, but it has the same effect as \n.

Test case:

public class MainApp {
    public static void main(String[] args) throws InterruptedException {
        while (true) {
            System.out.print("\r"); // no \n, no println
            System.out.print(java.time.LocalDateTime.now());
            Thread.sleep(1000);
        }
    }
}

Output:
2017-05-24T12:17:30.740
2017-05-24T12:17:31.756
2017-05-24T12:17:32.756
2017-05-24T12:17:33.756
2017-05-24T12:17:34.772
and so on

Expected output: A single line which is updated every second

Building Maven projects is also affected. Without --batch-mode, the output window contains many lines like
Progress (1): 4.1/34 kB
Progress (1): 7.9/34 kB
Progress (1): 12/34 kB
Progress (1): 16/34 kB
Progress (1): 20/34 kB
Progress (1): 24/34 kB
Progress (1): 28/34 kB
Progress (1): 32/34 kB
Progress (1): 33/34 kB
Progress (1): 34 kB
which should disappear because they also use \r.

Similar bugs: bug 130857, bug 206505, bug 217328, bug 239126

Product Version: NetBeans IDE Dev (Build 201705230001)
Java: 1.8.0_121; Java HotSpot(TM) 64-Bit Server VM 25.121-b13
Runtime: Java(TM) SE Runtime Environment 1.8.0_121-b13
System: Windows 10 version 10.0 running on amd64; Cp1252; de_DE (nb)