diff options
author | Jim Porter <jporterbugs@gmail.com> | 2023-03-30 17:39:24 -0700 |
---|---|---|
committer | Jim Porter <jporterbugs@gmail.com> | 2023-03-31 13:07:36 -0700 |
commit | 6419d78fa6f8a7794893da5a8a5d65f75a5a29fa (patch) | |
tree | 517f0137a0d8f444f27dea31dd793a9a711bd23c /lisp/eshell/esh-cmd.el | |
parent | 3bdbb66efb9895b8ed55270075fa7d8329f8d36b (diff) | |
download | emacs-6419d78fa6f8a7794893da5a8a5d65f75a5a29fa.tar.gz emacs-6419d78fa6f8a7794893da5a8a5d65f75a5a29fa.tar.bz2 emacs-6419d78fa6f8a7794893da5a8a5d65f75a5a29fa.zip |
Fix using background commands in 'eshell-command'
Do not merge to master.
This regressed due to the patch for bug#53715, which changed how
Eshell pipelines return the processes in the pipeline (bug#62556).
* lisp/eshell/esh-cmd.el (eshell-eval-command): Allow process-pairs.
* test/lisp/eshell/eshell-tests.el (eshell-test/eshell-command/simple)
(eshell-test/eshell-command/pipeline)
(eshell-test/eshell-command/background)
(eshell-test/eshell-command/background-pipeline): New tests.
Diffstat (limited to 'lisp/eshell/esh-cmd.el')
-rw-r--r-- | lisp/eshell/esh-cmd.el | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el index f4ac384ccc5..706477a5f45 100644 --- a/lisp/eshell/esh-cmd.el +++ b/lisp/eshell/esh-cmd.el @@ -1032,18 +1032,20 @@ produced by `eshell-parse-command'." (setq eshell-current-command command) (let* ((delim (catch 'eshell-incomplete (eshell-resume-eval))) - (val (car-safe delim))) + (val (car-safe delim)) + (val-is-process (or (eshell-processp val) + (eshell-process-pair-p val)))) ;; If the return value of `eshell-resume-eval' is wrapped in a ;; list, it indicates that the command was run asynchronously. ;; In that case, unwrap the value before checking the delimiter ;; value. (if (and val - (not (eshell-processp val)) + (not val-is-process) (not (eq val t))) (error "Unmatched delimiter: %S" val) ;; Eshell-command expect a list like (<process>) to know if the ;; command should be async or not. - (or (and (eshell-processp val) delim) val))))) + (or (and val-is-process delim) val))))) (defun eshell-resume-command (proc status) "Resume the current command when a process ends." |