Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WriteLine not work with .net Framework #50

Open
hepter opened this issue Aug 25, 2019 · 2 comments
Open

WriteLine not work with .net Framework #50

hepter opened this issue Aug 25, 2019 · 2 comments

Comments

@hepter
Copy link

hepter commented Aug 25, 2019

I'm using with .Net framework .Nothing appears except the first line. I changed some of code parts , but console still not showing like the .net core example
image

@hepter hepter changed the title WriteLine now work with .net Framework WriteLine not work with .net Framework Aug 25, 2019
@budul100
Copy link

The problem is apparently caused in the WriteConsoleLine function. On certain circumstances, the rolling back of the cursor with Console.Write("\r") is not working correctly.

If you replace the current code by the following code, then it should work in the .NET framework, too:

private void WriteConsoleLine(ConsoleOutLine m)
{
	var resetString = new string(' ', Console.WindowWidth);

	var line = Console.CursorTop;
	Console.Write(resetString);
	Console.SetCursorPosition(0, line);

	var foreground = Console.ForegroundColor;
	var background = Console.BackgroundColor;
	var written = _writeMessageToConsole(m);
	Console.ForegroundColor = foreground;
	Console.BackgroundColor = background;
	_originalCursorTop += written;
}

@yellowz06
Copy link

I am having the same issue, will this be fixed in future release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants