Bug 8013 - mono prints escape sequences ^[[1;1R^[[1;8R even when stdout is not the standard output
Summary: mono prints escape sequences ^[[1;1R^[[1;8R even when stdout is not the stand...
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: mscorlib (show other bugs)
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-10-26 04:25 UTC by aakashrc
Modified: 2017-07-13 00:20 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 8013 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEW

Description aakashrc 2012-10-26 04:25:11 UTC
When I am executing a mono program with expect script, garbage cursur output is being printed on the screen.
Following is the C# source code that I am executing:

========================================================

using System;
 
public class HelloWorld
{
    static public void Main ()
    {
      	string lineTC = Console.ReadLine();
 	int numTc=0;
      	if (int.TryParse(lineTC, out numTc)) 
		{
          	for(int i = 0; i < numTc; i++)
            {
              	string line = Console.ReadLine();
              	int num=0;
              	if(int.TryParse(line, out num))
                {
                  	Console.WriteLine(isPrime(num));
                }
            }
	}
    }
    static private int isPrime(int num)
    {
    	int i=2;
    	for(;i<=num/2;i++)
    	{           
        	if(num%i == 0)          
        	{                       
            	return 0;                           
        	}                       
    	}           
    	return 1;   
    }
}

=============================================================

Following is the expect script code:

#!/usr/bin/expect

spawn mono submission.exe
send "10\n"
send "2\n"
expect "1\n"
send "111\n"
expect "0\n"
send "100001\n"
expect "0\n"
send "111111\n"
expect "0\n"
send "786431\n"
expect "1\n"
send "10000007\n"
expect "0\n"
send "1442968193\n"
expect "1\n"
send "2147483647\n"
expect "1\n"
send "999999000001\n"
send "1111111111111111111\n"

interact

================================================================

The output from expect is as follows:
./exp.exp 
spawn mono submission.exe
10
2
1
111
0
100001
0
111111
0
786431
1
^[[1;1R^[[1;8R1
^[[2;1R111
0
^[[4;1R100001
0
^[[6;1R111111
0
^[[8;1R786431
1
^[[10;1R10000007
0
^[[12;1R1442968193
1
^[[14;1R2147483647
1
^[[16;1R999999000001
Comment 1 Rodrigo Kumpera 2017-07-13 00:20:42 UTC
This is a BCL bug in the console driver.