✅ How is Environment.UserInteractive set on Linux?
I am launching a subprocess from another program on Linux, which then tries to do this:
which gets ruck on the ReadKey.
If I redirect stdin from /dev/null (or a
yes process, even) then I get this exception:
Unhandled exception. System.InvalidOperationException: Cannot read keys when either application does not have a console or when console input has been redirected. Try Console.Read.
How is C# checking whether the environment is interactive? I need to override that when creating my subprocess, so it skips this conditional entirely.8 Replies
Unknown User•4w ago
Message Not Public
Sign In & Join Server To View
GitHub
runtime/src/libraries/System.Private.CoreLib/src/System/Environment...
.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps. - dotnet/runtime
yeah, I just found that :/
GitHub
Should we revise implementation of Environment.UserInteractive? · ...
This is currently implemented as return true; but since in 3.0 we're adding UI stacks to .NET Core, maybe we should implement this since this is usually used before popping a UI? The Windows ve...
Unknown User•4w ago
Message Not Public
Sign In & Join Server To View
The C# code and program aren't mine. I'm trying to work around this behavior from outside.
Unknown User•4w ago
Message Not Public
Sign In & Join Server To View
If you have no further questions, please use /close to mark the forum thread as answered