Skip to content

rustup-init.sh fails in zsh due to no word-splitting of curl "--retry 3" #3474

Closed
@alexhudspith

Description

@alexhudspith

Problem

zsh does not enable word-splitting by default and this causes the rustup-init.sh script to fail with:

info: downloading installer
curl: option --retry 3 -C -: is unknown
curl: try 'curl --help' or 'curl --manual' for more information

This is because zsh is interpreting --retry 3 -C - as a single argument, instead of splitting to --retry, 3, -C, -.

Tested with Linux zsh 5.8.1.

Steps

  1. Download rustup-init.sh to a machine with a curl supporting curl --retry
  2. Execute zsh rustup-init.sh

Possible Solution(s)

Use setopt shwordsplit when zsh is detected.

Notes

No response

Rustup version

rustup-init 1.26.0 (5af9b9484 2023-04-05)

Installed toolchains

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions