Don't write \b when output is redirected

Fixes #6096
This commit is contained in:
Matt Ellis 2017-03-21 18:03:17 -07:00
parent 09f07e8b04
commit bdfc759350

View file

@ -29,9 +29,16 @@ namespace Microsoft.DotNet.Archive
string line = $"{value.Phase} {progress}%";
if (value.Phase == _currentPhase)
{
Console.Write(new string('\b', _lastLineLength));
if (Console.IsOutputRedirected)
{
Console.Write($"...{progress}%");
}
else
{
Console.Write(new string('\b', _lastLineLength));
Console.Write(line);
}
Console.Write(line);
_lastLineLength = line.Length;
if (progress == 100)