Compose: zsh completion: parse error near `)'

Created on 10 Jul 2015  路  5Comments  路  Source: docker/compose

I get an error, when I run the command from https://docs.docker.com/compose/completion/ to install completion for zsh:

manu:~/ $ mkdir -p ~/.zsh/completion
manu:~/ $ curl -L https://raw.githubusercontent.com/docker/compose/
$\(docker-compose --version | awk 'NR==1{print $NF}')/contrib/compl
etion/zsh/_docker-compose > ~/.zsh/completion/_docker-compose
zsh: parse error near `)'

Most helpful comment

The command you typed is different from the command in the docs:

curl -L https://raw.githubusercontent.com/docker/compose/$\(docker-compose --version | awk 'NR==1{print $NF}')/contrib/completion/zsh/_docker-compose > ~/.zsh/completion/_docker-compose
# vs. the correct one
curl -L https://raw.githubusercontent.com/docker/compose/$(docker-compose --version | awk 'NR==1{print $NF}')/contrib/completion/zsh/_docker-compose > ~/.zsh/completion/_docker-compose

See the backslash that was added, might be because of some auto-escaping going on in your terminal. This issue should be closed?

All 5 comments

The command you typed is different from the command in the docs:

curl -L https://raw.githubusercontent.com/docker/compose/$\(docker-compose --version | awk 'NR==1{print $NF}')/contrib/completion/zsh/_docker-compose > ~/.zsh/completion/_docker-compose
# vs. the correct one
curl -L https://raw.githubusercontent.com/docker/compose/$(docker-compose --version | awk 'NR==1{print $NF}')/contrib/completion/zsh/_docker-compose > ~/.zsh/completion/_docker-compose

See the backslash that was added, might be because of some auto-escaping going on in your terminal. This issue should be closed?

You're right! I didn't notice the backslash, happens the first time to me. I also tried to copy paste into different terminal emulators: urxvt, xfce4-terminal, lxterminal. Everywhere the same behaviour. The backslash was added from the terminal. Maybe this should be mentioned in the documentation. Thanks for the quick solution!

Thx for the insight @LeoCavaille, I didn't notice the backslack either.

For anyone else encountering this issue, it is in fact an issue with zsh adding backslashes to URLs

https://stackoverflow.com/questions/25614613/how-to-disable-zsh-substitution-autocomplete-with-url-and-backslashes

Thanks, @leggomuhgreggo . For anybody else running into this remove the backslash from $\(uname -s) when pasting the command in ZSH.

Was this page helpful?
0 / 5 - 0 ratings