Skip to content

Tab completion doesn't show files whose names differ from others by case only #3455

@dkaszews

Description

@dkaszews

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues, especially the pinned issues.

Exception report

N/A

Screenshot

N/A

Environment data

PS Version: 7.3.0-preview.7
PS HostName: ConsoleHost
PSReadLine Version: 2.2.6
PSReadLine EditMode: Vi
OS: Linux Cuddles-Berry 5.15.0-1015-raspi #17-Ubuntu SMP PREEMPT Mon Sep 12 13:14:51 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
BufferWidth: 208
BufferHeight: 55

Steps to reproduce

Promoted from PowerShell/PowerShell#14365

Non-Windows filesystems are case-sensitive, and there has been an option fsutil.exe file queryCaseSensitiveInfo $path enable to make Windows also case sensitive on per-folder basis (useful for interop, e.g. WSL or checking out repositories with mixed-case files). PSReadLine suggestion deduplication logic uses HashSet<string>(StringComparer.OrdinalIgnoreCase) which is then a problem when you have files differing only in case.

Repro steps:

$tempdir = "tmp:/$(Get-Random)"
New-Item $tempdir Directory
if ($PSVersionTable.OS -match 'Windows') { fsutil.exe file queryCaseSensitiveInfo $tempdir enable }
New-Item 'TEST', 'test'
# input: ./t<TAB><TAB>

Expected behavior

Suggestions cycle between ./test and ./TEST

Actual behavior

Suggestion shows only one option, usually ./TEST because it was created earlier, but may by environment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions