fix(complete): Adjust how IFS is passed to clap

No idea why using passing along `IFS` isn't workong on my machine (but is for tests).

Fixes #5730
This commit is contained in:
Ed Page 2024-09-17 14:54:11 -05:00
parent df1efca035
commit 5d7c16c60e
2 changed files with 3 additions and 3 deletions

View file

@ -40,7 +40,7 @@ _clap_complete_NAME() {
local _CLAP_COMPLETE_SPACE=true
fi
COMPREPLY=( $( \
IFS="$IFS" \
_CLAP_IFS="$IFS" \
_CLAP_COMPLETE_INDEX="$_CLAP_COMPLETE_INDEX" \
_CLAP_COMPLETE_COMP_TYPE="$_CLAP_COMPLETE_COMP_TYPE" \
VAR="bash" \
@ -85,7 +85,7 @@ fi
let _space: Option<bool> = std::env::var("_CLAP_COMPLETE_SPACE")
.ok()
.and_then(|i| i.parse().ok());
let ifs: Option<String> = std::env::var("IFS").ok().and_then(|i| i.parse().ok());
let ifs: Option<String> = std::env::var("_CLAP_IFS").ok().and_then(|i| i.parse().ok());
let completions = crate::engine::complete(cmd, args, index, current_dir)?;
for (i, candidate) in completions.iter().enumerate() {

View file

@ -11,7 +11,7 @@ _clap_complete_exhaustive() {
local _CLAP_COMPLETE_SPACE=true
fi
COMPREPLY=( $( \
IFS="$IFS" \
_CLAP_IFS="$IFS" \
_CLAP_COMPLETE_INDEX="$_CLAP_COMPLETE_INDEX" \
_CLAP_COMPLETE_COMP_TYPE="$_CLAP_COMPLETE_COMP_TYPE" \
COMPLETE="bash" \