aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Porter2023-09-13 11:50:39 -0700
committerJim Porter2023-09-13 13:37:38 -0700
commit9838f786ded35fe49bbe84dd78af84df1337adbf (patch)
tree6a746c976ac81fec8882f345c50e95d13e4128b2
parent922d76e85615b39a9262d0f2c629dfd7e67b9e52 (diff)
downloademacs-9838f786ded35fe49bbe84dd78af84df1337adbf.tar.gz
emacs-9838f786ded35fe49bbe84dd78af84df1337adbf.zip
When waiting for processes in Eshell, wait until all the I/O is complete
This should fix bug#59103, bug#65590, and bug#65601. * lisp/eshell/esh-proc.el (eshell-sentinel): Set ':eshell-handles' to nil when finished with I/O. (eshell-wait-for-process): Wait until ':eshell-handles' is nil.
-rw-r--r--lisp/eshell/esh-proc.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/eshell/esh-proc.el b/lisp/eshell/esh-proc.el
index 5df68947ec2..afd0ed80132 100644
--- a/lisp/eshell/esh-proc.el
+++ b/lisp/eshell/esh-proc.el
@@ -161,7 +161,11 @@ The signals which will cause this to happen are matched by
161 "Wait until PROCS have successfully completed." 161 "Wait until PROCS have successfully completed."
162 (dolist (proc procs) 162 (dolist (proc procs)
163 (when (eshell-processp proc) 163 (when (eshell-processp proc)
164 (while (process-live-p proc) 164 (while (or (process-live-p proc)
165 ;; If we have handles, this is an Eshell-managed
166 ;; process. Wait until we're 100% done and have
167 ;; cleared out the handles (see `eshell-sentinel').
168 (process-get proc :eshell-handles))
165 (when (input-pending-p) 169 (when (input-pending-p)
166 (discard-input)) 170 (discard-input))
167 (sit-for eshell-process-wait-seconds 171 (sit-for eshell-process-wait-seconds
@@ -530,6 +534,9 @@ PROC is the process that's exiting. STRING is the exit message."
530 status 534 status
531 (when status (list 'quote (= status 0))) 535 (when status (list 'quote (= status 0)))
532 handles) 536 handles)
537 ;; Clear the handles to mark that we're 100%
538 ;; finished with the I/O for this process.
539 (process-put proc :eshell-handles nil)
533 (eshell-debug-command 540 (eshell-debug-command
534 'process 541 'process
535 (format-message 542 (format-message