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 239126 - carriage return (\r) does not work in output window (bug reappeared in 7.4)
Summary: carriage return (\r) does not work in output window (bug reappeared in 7.4)
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Output Window (show other bugs)
Version: 7.4
Hardware: PC Windows 7 x64
: P2 normal (vote)
Assignee: Jaroslav Havlin
URL:
Keywords:
: 217328 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-12-04 17:54 UTC by chhh
Modified: 2013-12-16 09:00 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Possible fix (4.30 KB, patch)
2013-12-13 13:43 UTC, Jaroslav Havlin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description chhh 2013-12-04 17:54:51 UTC
this bug relating to output window has been closed a couple of times, but I see the same broken behavior in 7.4 now.

System.out.print("HOHOHO\rHAHAHA\n");

output:

run:
HOHOHO
HAHAHA
HOHOHO
HAHAHA
BUILD SUCCESSFUL (total time: 0 seconds)
Comment 1 chhh 2013-12-04 17:56:05 UTC
i meant that line twice:
    System.out.print("HOHOHO\rHAHAHA\n");
    System.out.print("HOHOHO\rHAHAHA\n");
Comment 2 Jaroslav Havlin 2013-12-13 13:43:19 UTC
Created attachment 143154 [details]
Possible fix

Patch that adds support for CR characters.

The patch seems to work quite fine, but I'll have to test it a little.

I'm afraid that some users might rely on the current behavior, and the patch could cause some trouble, although no modern system should use CR as line separator.

Have you considered ANSI sequence \u001B[2K instead of CR? It works similarly, should work on most systems, and is already supported in NetBeans:

System.out.println("HOHOHO\u001B[2KHAHAHA");

Thank you for reporting.
Comment 3 Jaroslav Havlin 2013-12-16 08:57:36 UTC
The patch was integrated as http://hg.netbeans.org/core-main/rev/c26ddc99cc53.
Please verify the fix. Thank you.
Comment 4 Jaroslav Havlin 2013-12-16 09:00:04 UTC
*** Bug 217328 has been marked as a duplicate of this bug. ***