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 206505 - Escape sequences ( backspace \b and carriage return \r ) do not work in netbeans output but work fine if program is run from command prompt
Summary: Escape sequences ( backspace \b and carriage return \r ) do not work in netbe...
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Output Window (show other bugs)
Version: 7.0.1
Hardware: All Windows 7 x64
: P3 normal with 1 vote (vote)
Assignee: Jaroslav Havlin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-18 08:34 UTC by mohitgupta
Modified: 2015-03-16 08:19 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mohitgupta 2011-12-18 08:34:10 UTC
Product Version = NetBeans IDE 7.0.1 (Build 201107282000)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.7.0_01
Runtime = Java HotSpot(TM) 64-Bit Server VM 21.1-b02




My program:

class Variable{
    public static void main(String[] arguments){
        
       System.out.println("You \b are a great dancer");
       System.out.println("God \r is great");

    }
}
  

Output:
run:
You  are a great dancer
God  is great
BUILD SUCCESSFUL (total time: 0 seconds)
Comment 1 mohitgupta 2011-12-18 08:36:22 UTC
This is a serious bug in netbeans 7.0.1 . Sometimes \t character doesnt work in netbeans. Can someone explain why??
Comment 2 mohitgupta 2011-12-18 08:39:38 UTC
My program:

class Variable{
    public static void main(String[] arguments){
        
       System.out.println("You \b are a great dancer");
       System.out.println("God \r is great");

    }
}
  

Output:
run:
You  are a great dancer
God  is great
BUILD SUCCESSFUL (total time: 0 seconds)
Comment 3 Jaroslav Havlin 2012-01-02 10:15:34 UTC
Already fixed. See bug 130857 and bug 142692.
Please try a newer version (daily build, 7.1 RC2 or wait for 7.1).
Comment 4 Darker 2015-03-12 23:20:53 UTC
The problem wasn't fixed or has returned - I'm using version 7.4 and the \r character is NOT working.
Comment 5 Jaroslav Havlin 2015-03-13 09:13:19 UTC
> The problem wasn't fixed or has returned - I'm using version 7.4 and the \r 
> character is NOT working.
Can you please provide a test case (something similar to comment 2).
What is the actual behavior and what behavior is expected?
Can you also please attach your IDE Log, or check which version of module core.output2 are you using?
Thank you.
Comment 6 Darker 2015-03-15 22:15:51 UTC
(In reply to Jaroslav Havlin from comment #5)
> > The problem wasn't fixed or has returned - I'm using version 7.4 and the \r 
> > character is NOT working.
> Can you please provide a test case (something similar to comment 2).
> What is the actual behavior and what behavior is expected?

Is the test case in the initial comment working for you? Sorry, but I don't know what I'm using for output. I just downloaded IDE, used it and found a bug. I already happened to notice that sometimes developers will ask a million questions instead of testing whether the problem exists and fixing it. But NetBeans is not my project to debug. Unless you're unable to reproduce the problem, I have no more business here.

Also if you don't know what is expected from \r character you might be not suitable person to discuss this issue. \r character is CARRIAGE RETURN. It existed in DOS operating system to allow easy text transmission to CNC typewriters. It than persisted until today for backwards compatibility. They even still appear in HTTP communication headers, costing tarrabytes of traffic worldwide. Linux, a younger OS, doesn't use them in text files, but it's a defined ASCII character.


In console, it's expected to put the "output source" at the beginning of the line. In console applications, it's used to rewrite already written line. In netbeans, it acts as \n character.

In fact, there existed special ink that would allow you to do the same with real world type machines and their carriage return function.
Comment 7 Jaroslav Havlin 2015-03-16 08:19:01 UTC
(In reply to Darker from comment #6)
> Is the test case in the initial comment working for you?
Yes. The output I get is this:

run:
You are a great dancer
 is great
BUILD SUCCESSFUL (total time: 0 seconds)

It seems to work fine. That's why I asked what you had expected.

I see now that the fix is in NB version 8.0, it's not fixed yet in 7.4, I'm sorry.

Problem with \r fixed, see bug 239126.
Problem with \b fixed, see bug 228051.
 -> Closing as fixed, setting target milestone to 8.0.