diff --git a/lisp/tramp.el b/lisp/tramp.el index 7e028ecf..43992519 100644 --- a/lisp/tramp.el +++ b/lisp/tramp.el @@ -4090,6 +4090,8 @@ The terminal type can be configured with `tramp-terminal-type'." (defun tramp-action-process-alive (proc _vec) "Check, whether a process has finished." (unless (process-live-p proc) + ;; There might be pending output. + (while (tramp-accept-process-output proc 0)) (throw 'tramp-action 'process-died))) (defun tramp-action-out-of-band (proc vec)