Skip to content

Commit

Permalink
Release 0.23.0
Browse files Browse the repository at this point in the history
  • Loading branch information
geoperez committed Dec 5, 2017
1 parent e57d7b8 commit fd22f59
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
8 changes: 8 additions & 0 deletions src/Unosquare.Swan/Terminal.Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,14 @@ static Settings()
/// The console options.
/// </value>
public static LogMessageType DisplayLoggingMessageType { get; set; }

/// <summary>
/// Gets or sets a value indicating whether [override is console present].
/// </summary>
/// <value>
/// <c>true</c> if [override is console present]; otherwise, <c>false</c>.
/// </value>
public static bool OverrideIsConsolePresent { get; set; }
}
}
}
8 changes: 5 additions & 3 deletions src/Unosquare.Swan/Terminal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static partial class Terminal
private static readonly ManualResetEvent OutputDone = new ManualResetEvent(false);
private static readonly ManualResetEvent InputDone = new ManualResetEvent(true);

private static bool? m_IsConsolePresent;
private static bool? m_IsConsolePresent;

#endregion

Expand Down Expand Up @@ -86,7 +86,7 @@ static Terminal()
}

#endregion

#region Synchronized Cursor Movement

/// <summary>
Expand Down Expand Up @@ -160,6 +160,8 @@ public static bool IsConsolePresent
{
get
{
if (Settings.OverrideIsConsolePresent) return true;

if (m_IsConsolePresent == null)
{
m_IsConsolePresent = true;
Expand Down Expand Up @@ -333,7 +335,7 @@ private static void DequeueOutputAsync()
if (OutputQueue.TryDequeue(out var context) == false) continue;

// Process Console output and Skip over stuff we can't display so we don't stress the output too much.
if (IsConsolePresent && OutputQueue.Count <= Console.BufferHeight)
if (IsConsolePresent && (Settings.OverrideIsConsolePresent || OutputQueue.Count <= Console.BufferHeight))
{
// Output to the standard output
if (context.OutputWriters.HasFlag(TerminalWriters.StandardOutput))
Expand Down
2 changes: 1 addition & 1 deletion src/Unosquare.Swan/Unosquare.Swan.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<PackageId>Unosquare.Swan</PackageId>
<CodeAnalysisRuleSet>..\..\StyleCop.Analyzers.ruleset</CodeAnalysisRuleSet>
<DebugType>Full</DebugType>
<Version>0.22.0</Version>
<Version>0.23.0</Version>
<Authors>Unosquare</Authors>
<PackageIconUrl>https://github.com/unosquare/swan/raw/master/swan-logo-32.png</PackageIconUrl>
<PackageProjectUrl>https://github.com/unosquare/swan</PackageProjectUrl>
Expand Down

0 comments on commit fd22f59

Please sign in to comment.