mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-23 07:19:15 +00:00
Fix executing commands in Eshell using "env" with no local variables
* 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).
This commit is contained in:
parent
c0ef8a9a1b
commit
11e3e0cadd
@ -436,7 +436,8 @@ the values of nil for each."
|
||||
: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"))))))
|
||||
|
@ -669,6 +669,11 @@ nil, use FUNCTION instead."
|
||||
(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")))
|
||||
|
||||
|
||||
;; Variable aliases
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user