Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ConsoleProgressMonitor.cs')
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ConsoleProgressMonitor.cs11
1 files changed, 4 insertions, 7 deletions
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ConsoleProgressMonitor.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ConsoleProgressMonitor.cs
index 82410eae20..90cecfdb54 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ConsoleProgressMonitor.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ConsoleProgressMonitor.cs
@@ -51,15 +51,12 @@ namespace MonoDevelop.Core.ProgressMonitoring
public ConsoleProgressMonitor () : this (Console.Out, true)
{
//TODO: can we efficiently update Console.WindowWidth when it changes?
- // TODO: Use Console.IsOutputRedirected in .NET 4.5.
- try {
- columns = Console.WindowWidth;
- }
//when the output is redirected, Mono returns 0 but .NET throws IOException
- catch (IOException) {
+ if (Console.IsOutputRedirected)
columns = 0;
- }
-
+ else
+ columns = Console.WindowWidth;
+
wrap = columns > 0;
}