commit aa072db86b6b06b54d7f5846231bdf4a73b0cd84 (HEAD, refs/remotes/origin/master) Author: Michael Albinus Date: Sat Apr 11 09:08:54 2020 +0200 * lisp/net/tramp.el (tramp-action-process-alive): Read pending output. diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index e30f27fd33..a16085d7fb 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -4074,6 +4074,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)