legacy-cli icon indicating copy to clipboard operation
legacy-cli copied to clipboard

Autocompletion not working on Windows with a fresh install

Open lolautruche opened this issue 3 years ago • 1 comments

On Windows 10, using Git Bash, after the regular setup, the autocompletion outputs the following message:

$ platform bash: C:UsersIEUser.platformshbinplatform: command not found

It seems that the \ character is stripped in the path. Having a look at the generated autocompletion.sh, I figured out that the path to the platform CLI is not quoted, and the \ are not doubled.

I was able to fix the issue by replacing:

RESULT=$(C:\Users\IEUser\.platformsh\bin\platform _completion --shell-type bash >/dev/null)

by:

RESULT=$("C:\Users\IEUser\.platformsh\bin\platform" _completion --shell-type bash >/dev/null)

After this change, and after sourcing ~/.bashrc, the autocompletion works. It ouputs another error, but probably related to the Windows Bash implementation:

__ltrim_colon_completions: command not found

lolautruche avatar Oct 20 '22 08:10 lolautruche

The autocompletion script generation is done in stecman/symfony-console-completion, which is called by the self:install command. The program path is directly passed here. #1174 adds quotes around it.

lolautruche avatar Oct 26 '22 08:10 lolautruche