Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocompletion not working on Windows with a fresh install #1171

Open
lolautruche opened this issue Oct 20, 2022 · 1 comment
Open

Autocompletion not working on Windows with a fresh install #1171

lolautruche opened this issue Oct 20, 2022 · 1 comment

Comments

@lolautruche
Copy link

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 added a commit to lolautruche/platformsh-cli that referenced this issue Oct 26, 2022
Add quotes around the application executable before passing it to the autocomplete hook script.
Quoting prevents issues with the path when containing special characters (WS and/or `\`).
@lolautruche
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant