TheLocehiliosan / yadm

Yet Another Dotfiles Manager
https://yadm.io/
GNU General Public License v3.0
4.94k stars 178 forks source link

bash completions don't like files with spaces #341

Open coderforlife opened 3 years ago

coderforlife commented 3 years ago

When using bash (and possibly other shells), trying to complete a file name with a space leads to issues. For example:

touch "hello world.txt"
yadm he<tab>

doesn't complete anything, double lists two entries hello and world.txt, if typing up to hello\ causes the word to be replaced with hello\\\, and similarly hello\ w completes to hello\\\ w. If you are past the argument with a space then things work, for example yadm add hello\ world.txt fo<tab> will complete to yadm add hello\ world.txt foo.txt.

Interestingly, if the file that contains a space is already added to yadm, then it completes just fine regardless of where in the file you are.

TheLocehiliosan commented 3 years ago

@coderforlife Is it possible to test if your git completions work the same way?

coderforlife commented 3 years ago

No, git functions correctly. If I do the following:

mkdir test
cd test
git init
touch "hello world.txt"
git add he<tab>

it completes to hello\ world.txt as expected. Also works right after the space and anywhere after the space.

TheLocehiliosan commented 3 years ago

Thanks for that test. 👍

github-actions[bot] commented 2 years ago

This issue has been labeled as stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 2 years ago

This issue has been labeled as stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.