domsleee / posh-tabcomplete

Blazing fast tab completion for powershell.
4 stars 1 forks source link

Files with spaces in their name are not tab-completed correctly #19

Closed mathieures closed 7 months ago

mathieures commented 7 months ago

Hello, on version 0.2.0 there is an issue where only the last part of the name of a file is tab-completed when it has one or more spaces in its name. I can reproduce an issue when a file contains spaces in its name.

I am not knowledgeable about Rust, but quickly looking at the code, it seems like the origin of the bug is this line: https://github.com/domsleee/posh-tabcomplete/blob/c8689a176a5a039bb23c8884bff1f5e828d23869/src/main.rs#L50

Sadly I don't know the code and the language well enough to propose a fix, but I can provide you with more information about my setup etc. if needed.

I can easily reproduce the bug by following these steps:

git init test
cd test
Invoke-Expression (&posh-tabcomplete init | Out-String)
New-Item -Name 'file with spaces.txt'
git add <tab>

Expected output:

git add 'file with spaces.txt'

Actual output:

git add spaces.txt`

All in all, awesome tool! I've used it for months and only now encounter this bug.

domsleee commented 7 months ago

Thanks for your detailed report, the issue should be fixed in 0.2.1 🎉

mathieures commented 7 months ago

I can confirm this is fixed in 0.2.1. Thank you so much for the blazing fast fix!