You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try the autocomplete feature in bash with file names that contain spaces, the completion fails, because the parts of the name are treated separately.
So if I have a file named file with spaces.txt and type fi, then nothing happens on first TAB (despite no other file matches fi), and on the second TAB I get the list: file spaces.txt with as possible completions, which is the correctly found filename, but the parts sorted alphabetically.
It looks for me like the result of some missing quotes or something like that, but I know very few of bash autocompletion, so I don't know how to fix it.
The text was updated successfully, but these errors were encountered:
using the approach by https://stackoverflow.com/a/26511572. This appears to properly format paths with spaces.
It does, however, introduce a dependency on mapfile which is builtin since Bash 4 from 2009.
Unintended splits on spaces is also an issue for custom completion (source).
Here's a minimal example that shows the issue:
When I try the autocomplete feature in bash with file names that contain spaces, the completion fails, because the parts of the name are treated separately.
So if I have a file named
file with spaces.txt
and typefi
, then nothing happens on first TAB (despite no other file matchesfi
), and on the second TAB I get the list:file spaces.txt with
as possible completions, which is the correctly found filename, but the parts sorted alphabetically.It looks for me like the result of some missing quotes or something like that, but I know very few of bash autocompletion, so I don't know how to fix it.
The text was updated successfully, but these errors were encountered: