Skip to content

Commit 312051b

Browse files
Merge pull request #1751 from PowerShell/andschwa/readkey
Re-workaround uncancellable `Console.ReadKey`
2 parents c49fa2a + 7bc13d0 commit 312051b

16 files changed

+78
-1005
lines changed

.vsts-ci/templates/release-general.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ steps:
4646
**/Newtonsoft.Json.dll
4747
**/OmniSharp*.dll
4848
**/Serilog*.dll
49-
**/UnixConsoleEcho.dll
5049
5150
# The SBOM generation requires our original sources with the `dotnet restore`
5251
# produced `project.assets.json` files.

Third Party Notices.txt

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,6 @@ This file is based on or incorporates material from the projects listed below (T
44

55
---
66

7-
UnixConsoleEcho
8-
9-
Copyright (c) 2017 Patrick Meinecke
10-
Provided for Informational Purposes Only
11-
12-
MIT License
13-
14-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
15-
16-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
17-
18-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19-
20-
---
21-
227
Serilog
238

249
Copyright 2013-2015 Serilog Contributors

src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@
1212
using System.Management.Automation.Runspaces;
1313
using Microsoft.PowerShell.EditorServices.Hosting;
1414
using System.Globalization;
15-
using System.Collections;
16-
17-
// TODO: Remove this when we drop support for PS6.
18-
#if CoreCLR
19-
using System.Runtime.InteropServices;
20-
#endif
2115

2216
#if DEBUG
2317
using System.Diagnostics;
@@ -35,14 +29,6 @@ namespace Microsoft.PowerShell.EditorServices.Commands
3529
[Cmdlet(VerbsLifecycle.Start, "EditorServices", DefaultParameterSetName = "NamedPipe")]
3630
public sealed class StartEditorServicesCommand : PSCmdlet
3731
{
38-
// TODO: Remove this when we drop support for PS6.
39-
private static readonly bool s_isWindows =
40-
#if CoreCLR
41-
RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
42-
#else
43-
true;
44-
#endif
45-
4632
private readonly List<IDisposable> _disposableResources;
4733

4834
private readonly List<IDisposable> _loggerUnsubscribers;
@@ -420,12 +406,7 @@ private ConsoleReplKind GetReplKind()
420406
return ConsoleReplKind.None;
421407
}
422408

423-
// TODO: Remove this when we drop support for PS6.
424-
Hashtable psVersionTable = (Hashtable)SessionState.PSVariable.GetValue("PSVersionTable");
425-
dynamic version = psVersionTable["PSVersion"];
426-
int majorVersion = (int)version.Major;
427-
428-
if (UseLegacyReadLine || (!s_isWindows && majorVersion == 6))
409+
if (UseLegacyReadLine)
429410
{
430411
_logger.Log(PsesLogLevel.Diagnostic, "REPL configured as Legacy");
431412
return ConsoleReplKind.LegacyReadLine;

src/PowerShellEditorServices/PowerShellEditorServices.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
<PackageReference Include="System.IO.Pipes.AccessControl" Version="5.0.0" />
3939
<PackageReference Include="System.Security.Principal" Version="4.3.0" />
4040
<PackageReference Include="System.Security.Principal.Windows" Version="5.0.0" />
41-
<PackageReference Include="UnixConsoleEcho" Version="0.1.0" />
4241
</ItemGroup>
4342

4443
<ItemGroup>

src/PowerShellEditorServices/Services/PowerShell/Console/ConsoleProxy.cs

Lines changed: 0 additions & 199 deletions
This file was deleted.

0 commit comments

Comments
 (0)