Function: eshell-resume-command

eshell-resume-command is a byte-compiled function defined in esh-cmd.el.gz.

Signature

(eshell-resume-command PROC STATUS)

Documentation

Resume the current command when a pipeline ends.

PROC is the process that invoked this from its sentinel, and STATUS is its status.

Source Code

;; Defined in /usr/src/emacs/lisp/eshell/esh-cmd.el.gz
(defun eshell-resume-command (proc status)
  "Resume the current command when a pipeline ends.
PROC is the process that invoked this from its sentinel, and
STATUS is its status."
  (when proc
    ;; Iterate over all the commands associated with this process.  Each
    ;; element is a list of the form (BACKGROUND FORM PROCESSES) (see
    ;; `eshell-add-command').
    (dolist (command (eshell-commands-for-process proc))
      (unless (seq-some #'eshell-process-active-p (nth 2 command))
        (setf (nth 2 command) nil) ; Clear processes from command.
        (if (and ;; Check STATUS to determine whether we want to resume or
                 ;; abort the command.
                 (stringp status)
                 (not (string= "stopped" status))
                 (not (string-match eshell-reset-signals status)))
            (eshell-resume-eval command)
          (eshell-remove-command command)
          ;; Check if the command we just aborted is marked as a
          ;; background command.  If not, we need to reset the prompt so
          ;; the user can enter another command.
          (unless (car command)
            (declare-function eshell-reset "esh-mode" (&optional no-hooks))
            (eshell-reset)))))))