Skip to content

Commit c8db4f5

Browse files
authored
Do not filter out duplicate completions on non-Windows systems (#3454)
1 parent 3bc6561 commit c8db4f5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

PSReadLine/Completion.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using System.Diagnostics.CodeAnalysis;
1111
using System.Globalization;
1212
using System.Linq;
13+
using System.Runtime.InteropServices;
1314
using System.Management.Automation;
1415
using System.Management.Automation.Runspaces;
1516
using Microsoft.PowerShell.Internal;
@@ -299,7 +300,8 @@ private CommandCompletion GetCompletions()
299300
if (start < 0 || start > _singleton._buffer.Length) return null;
300301
if (length < 0 || length > (_singleton._buffer.Length - start)) return null;
301302

302-
if (_tabCompletions.CompletionMatches.Count > 1)
303+
// Only filter out duplicates on Windows.
304+
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && _tabCompletions.CompletionMatches.Count > 1)
303305
{
304306
// Filter out apparent duplicates
305307
var hashSet = new HashSet<string>(StringComparer.OrdinalIgnoreCase);

0 commit comments

Comments
 (0)