* lisp/eshell/esh-var.el (eshell/env): Throw 'eshell-replace-command' as
needed.
* test/lisp/eshell/esh-var-tests.el
(esh-var-test/local-variables/env/no-locals): New test (bug#73479).
(cherry picked from commit
11e3e0cadd46ee49007477af1335ddd5365debe2)
:usage "[NAME=VALUE]... [COMMAND]...")
(if args
(or (eshell-parse-local-variables args)
- (eshell-named-command (car args) (cdr args)))
+ (throw 'eshell-replace-command
+ `(eshell-named-command ,(car args) ',(cdr args))))
(eshell-with-buffered-print
(dolist (setting (sort (eshell-environment-variables) 'string-lessp))
(eshell-buffered-print setting "\n"))))))
(eshell-match-command-output "env VAR=hello env" "VAR=hello\n")
(should (equal (getenv "VAR") "value"))))
+(ert-deftest esh-var-test/local-variables/env/no-locals ()
+ "Test that \"env command\" works like \"command\"."
+ (with-temp-eshell
+ (eshell-match-command-output "env echo hi" "\\`hi\n")))
+
\f
;; Variable aliases