We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1013696 commit 5331396Copy full SHA for 5331396
Sharprompt/Drivers/DefaultConsoleDriver.cs
@@ -1,4 +1,5 @@
1
using System;
2
+using System.IO;
3
using System.Runtime.InteropServices;
4
5
using Sharprompt.Internal;
@@ -32,7 +33,14 @@ public DefaultConsoleDriver()
32
33
{
34
_previousTreatControlCAsInput = Console.TreatControlCAsInput;
35
- Console.TreatControlCAsInput = true;
36
+ try
37
+ {
38
+ Console.TreatControlCAsInput = true;
39
+ }
40
+ catch (IOException)
41
42
+ throw new InvalidOperationException(Resource.Message_NotSupportedEnvironment);
43
44
}
45
46
private readonly bool _previousTreatControlCAsInput;
0 commit comments