question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

On Linux, tab completion doesn't show files whose names differ from others by case only

See original GitHub issue

Note: The problem seems to be in the match-cycling logic, because TabExpansion2 is working properly.

Steps to reproduce

On Linux:

# Switch to a temp dir.
Push-Location (New-Item -Type Directory -Force "temp:/$PID")

# Create two files whose names differ only in case.
$null = New-Item foo.txt, FOO.txt

# Note that the following test SUCCEEDS.
# That is, the TabExpansion2 function correctly finds both names.
(TabExpansion2 './').CompletionMatches.CompletionText | Should -Be './foo.txt', './FOO.txt'

# However,  INTERACTIVE CYCLING is broken.
# Type "./" and press TAB to cycle through the matches.
# Currently only *1* name is found.

Code for later cleanup:

Pop-Location;  Remove-Item -Recurse "temp:/$PID"

Expected behavior

Tab-completion should cycle through ./foo.txt and /FOO.txt.

Actual behavior

Only one name is found, ./foo.txt

Environment data

PowerShell Core 7.2.0-preview.1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
MartinGC94commented, Oct 1, 2022

@dkaszews Neat. I just tested it on my Windows 11 PC and it works without issues if you unload the PSReadline module so if there was any doubt before that the issue was caused by PSReadline then that doubt should be cleared now.

1reaction
dkaszewscommented, Sep 28, 2022

Will see if changing the line found by @MartinGC94 to check if system is case insensitive (Windows) or case sensitive (mostly everything else) resolves the issue without breaking any tests.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Case-insensitive completion in bash
Tab completion is a feature of your shell (default is bash on most Linuxes, zsh on up-to-date Macs). But unix-style file and directory...
Read more >
bash - Tab completion only exists for ls but not for other ...
Type ls s* , and press tab twice will then list the candidate files. Type rm s , and press tab once will...
Read more >
file name auto completion works for ls but not for vi
It auto-completes to some degree, but when I don't give the start pattern at a directory entrance, it gives me no list of...
Read more >
Bash Auto-completion with Tab button doesn't ...
In my Kubuntu there is no /usr/share/bash-completion/completions/vim file, but the file /usr/share/bash-completion/bash_completion.
Read more >
Command-line completion
Command -line completion (also tab completion) is a common feature of command-line interpreters, in which the program automatically fills in partially typed ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found