diff --git a/clap_complete/src/env/shells.rs b/clap_complete/src/env/shells.rs index 427e214917b..ec6652a49de 100644 --- a/clap_complete/src/env/shells.rs +++ b/clap_complete/src/env/shells.rs @@ -157,12 +157,12 @@ impl EnvCompleter for Elvish { let script = r#" set edit:completion:arg-completer[BIN] = { |@words| - set E:_CLAP_IFS = "\n" + tmp E:_CLAP_IFS = "\n" var index = (count $words) set index = (- $index 1) - set E:_CLAP_COMPLETE_INDEX = (to-string $index) - set E:VAR = "elvish" + tmp E:_CLAP_COMPLETE_INDEX = (to-string $index) + tmp E:VAR = "elvish" put (COMPLETER -- $@words) | to-lines } diff --git a/clap_complete/tests/snapshots/home/dynamic-env/exhaustive/elvish/elvish/rc.elv b/clap_complete/tests/snapshots/home/dynamic-env/exhaustive/elvish/elvish/rc.elv index 5694024cb22..0999995b4b8 100644 --- a/clap_complete/tests/snapshots/home/dynamic-env/exhaustive/elvish/elvish/rc.elv +++ b/clap_complete/tests/snapshots/home/dynamic-env/exhaustive/elvish/elvish/rc.elv @@ -2,12 +2,12 @@ set edit:rprompt = (constantly "") set edit:prompt = (constantly "% ") set edit:completion:arg-completer[exhaustive] = { |@words| - set E:_CLAP_IFS = "\n" + tmp E:_CLAP_IFS = "\n" var index = (count $words) set index = (- $index 1) - set E:_CLAP_COMPLETE_INDEX = (to-string $index) - set E:COMPLETE = "elvish" + tmp E:_CLAP_COMPLETE_INDEX = (to-string $index) + tmp E:COMPLETE = "elvish" put (exhaustive -- $@words) | to-lines }