-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
A-completionArea: completion generatorArea: completion generatorC-enhancementCategory: Raise on the bar on expectationsCategory: Raise on the bar on expectationsE-hardCall for participation: Experience needed to fix: Hard / a lotCall for participation: Experience needed to fix: Hard / a lotE-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.
Description
Problem
cargo
does not complete correctly when I try to complete in the middle with sudo
using the native-completions
feature.
Steps
- Run
source <(CARGO_COMPLETE=bash cargo +nightly)
to ensure that we're usingnative-completions
feature - Create a cargo project with two examples,
apple
andbanana
- Invoke completion like this:
cargo build --example ap<TAB> --example banana
- Notice that we've got the correct result:
cargo build --example apple --example banana
- Prepend with
sudo
and invoke completion again:
sudo cargo build --example ap<TAB> --example banana
- Notice that we've got the wrong result:
sudo cargo build --example banana --example banana
Possible Solution(s)
No response
Notes
Completions by rustup completions bash
are correct in both cases, and this bug only occurs when using completions by CARGO_COMPLETE=bash cargo +nightly
.
Version
$ cargo +nightly version --verbose
cargo 1.91.0-nightly (71eb84f21 2025-08-17)
release: 1.91.0-nightly
commit-hash: 71eb84f21aef43c07580c6aed6f806a6299f5042
commit-date: 2025-08-17
host: x86_64-unknown-linux-gnu
libgit2: 1.9.1 (sys:0.20.2 vendored)
libcurl: 8.14.1-DEV (sys:0.4.82+curl-8.14.1 vendored ssl:OpenSSL/3.5.0)
ssl: OpenSSL 3.5.0 8 Apr 2025
os: Ubuntu 24.4.0 (noble) [64-bit]
Metadata
Metadata
Assignees
Labels
A-completionArea: completion generatorArea: completion generatorC-enhancementCategory: Raise on the bar on expectationsCategory: Raise on the bar on expectationsE-hardCall for participation: Experience needed to fix: Hard / a lotCall for participation: Experience needed to fix: Hard / a lotE-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.