-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
A-completionsArea: shell completionsArea: shell completionsC-bugCategory: bugCategory: bugS-blocked-externalStatus: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fixStatus: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fix
Description
Problem
The Bash completions don't work because they are not be sourced correctly.
Steps
Rustup expects Bash completions in ~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/etc/bash_completion.d/cargo:
$ rustup completions bash cargo
if command -v rustc >/dev/null 2>&1; then
source "$(rustc --print sysroot)"/etc/bash_completion.d/cargo
fi
Unfortunately, the completions are not there:
$ ls -d "$(rustc --print sysroot)"/etc/bash_completion.d/cargo
ls: cannot access '/home/stefan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/etc/bash_completion.d/cargo': No such file or directory
But, the completions are here:
$ file "$(rustc --print sysroot)"/src/etc/bash_completion.d/cargo
/home/stefan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/src/etc/bash_completion.d/cargo: ASCII text
Note the /src/etc instead of just /etc.
Possible Solution(s)
The Bash completions should be placed in /etc/bash_completion.d/cargo instead of /src/etc/bash_completion.d/cargo.
Notes
No response
Version
$ cargo --version
cargo 1.71.0 (cfd3bbd8f 2023-06-08)
Metadata
Metadata
Assignees
Labels
A-completionsArea: shell completionsArea: shell completionsC-bugCategory: bugCategory: bugS-blocked-externalStatus: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fixStatus: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fix