diff --git a/clap_complete/src/env/shells.rs b/clap_complete/src/env/shells.rs index 427e214917b..289d5f03be7 100644 --- a/clap_complete/src/env/shells.rs +++ b/clap_complete/src/env/shells.rs @@ -157,14 +157,10 @@ impl EnvCompleter for Elvish { let script = r#" set edit:completion:arg-completer[BIN] = { |@words| - set E:_CLAP_IFS = "\n" - var index = (count $words) set index = (- $index 1) - set E:_CLAP_COMPLETE_INDEX = (to-string $index) - set E:VAR = "elvish" - put (COMPLETER -- $@words) | to-lines + put (env _CLAP_IFS="\n" _CLAP_COMPLETE_INDEX=(to-string $index) VAR="elvish" COMPLETER -- $@words) | to-lines } "# .replace("COMPLETER", &completer) 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..56fc3985798 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,14 +2,10 @@ set edit:rprompt = (constantly "") set edit:prompt = (constantly "% ") set edit:completion:arg-completer[exhaustive] = { |@words| - set E:_CLAP_IFS = "\n" - var index = (count $words) set index = (- $index 1) - set E:_CLAP_COMPLETE_INDEX = (to-string $index) - set E:COMPLETE = "elvish" - put (exhaustive -- $@words) | to-lines + put (env _CLAP_IFS="\n" _CLAP_COMPLETE_INDEX=(to-string $index) COMPLETE="elvish" exhaustive -- $@words) | to-lines }