-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Console Target Automatic Detect if console is available on Mono #1706
Conversation
Strange that this build error has started to come "randomly":
|
#if !SILVERLIGHT && !__IOS__ && !__ANDROID__ && !MONO | ||
try | ||
{ | ||
if (!Environment.UserInteractive) | ||
{ | ||
if (Type.GetType("Mono.Runtime") != null && Console.In is StreamReader) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should add this to PlatformDetector and create a unit test for it? (we run on Travis which is Mono)
Guess I broke it then in 4.3.10 in #1680 :( Any idea how to fix this? Guess we need a timer and a check if it's used. |
58b6925
to
65d0d99
Compare
Current coverage is 80% (diff: 50%)@@ master #1706 diff @@
==========================================
Files 274 274
Lines 17031 17034 +3
Methods 2691 2692 +1
Messages 0 0
Branches 1904 1905 +1
==========================================
+ Hits 13664 13667 +3
- Misses 2930 2931 +1
+ Partials 437 436 -1
|
#if !SILVERLIGHT && !__IOS__ && !__ANDROID__ && !MONO | ||
try | ||
{ | ||
if (!Environment.UserInteractive) | ||
{ | ||
if (Internal.PlatformDetector.IsMono && Console.In is StreamReader) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ps
I found a way to figure out whether there is a console/terminal available or not under mono on linux: 'Mono.Unix.Native.Syscall.isatty(0)'.
http://stackoverflow.com/questions/9065065/how-to-detect-if-im-running-in-mono-service
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:)
Extended the console detection check to support Mono, that doesn't support Environment.UserInteractive. Attempt to fix #1704 (Not tested)
This change is