diff options
| -rw-r--r-- | lisp/eshell/esh-proc.el | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lisp/eshell/esh-proc.el b/lisp/eshell/esh-proc.el index b0dbb229152..ba5cb5c2db7 100644 --- a/lisp/eshell/esh-proc.el +++ b/lisp/eshell/esh-proc.el | |||
| @@ -393,8 +393,20 @@ PROC is the process that's exiting. STRING is the exit message." | |||
| 393 | (unless (string= string "run") | 393 | (unless (string= string "run") |
| 394 | (unless (string-match "^\\(finished\\|exited\\)" string) | 394 | (unless (string-match "^\\(finished\\|exited\\)" string) |
| 395 | (eshell-insertion-filter proc string)) | 395 | (eshell-insertion-filter proc string)) |
| 396 | (eshell-close-handles (process-exit-status proc) 'nil | 396 | (let ((handles (nth 1 entry)) |
| 397 | (cadr entry)))) | 397 | (str (prog1 (nth 3 entry) |
| 398 | (setf (nth 3 entry) nil))) | ||
| 399 | (status (process-exit-status proc))) | ||
| 400 | ;; If we're in the middle of handling output | ||
| 401 | ;; from this process then schedule the EOF for | ||
| 402 | ;; later. | ||
| 403 | (letrec ((finish-io | ||
| 404 | (lambda () | ||
| 405 | (if (nth 4 entry) | ||
| 406 | (run-at-time 0 nil finish-io) | ||
| 407 | (when str (eshell-output-object str nil handles)) | ||
| 408 | (eshell-close-handles status 'nil handles))))) | ||
| 409 | (funcall finish-io))))) | ||
| 398 | (eshell-remove-process-entry entry)))) | 410 | (eshell-remove-process-entry entry)))) |
| 399 | (eshell-kill-process-function proc string))))) | 411 | (eshell-kill-process-function proc string))))) |
| 400 | 412 | ||