Function: eshell-commands-for-process

eshell-commands-for-process is a byte-compiled function defined in esh-cmd.el.gz.

Signature

(eshell-commands-for-process PROCESS)

Documentation

Return all commands associated with a PROCESS.

Each element will have the form (BACKGROUND FORM PROCESSES), as returned by eshell-add-command (which see).

Usually, there should only be one element in this list, but it's theoretically possible to have more than one associated command for a given process.

Source Code

;; Defined in /usr/src/emacs/lisp/eshell/esh-cmd.el.gz
(defun eshell-commands-for-process (process)
  "Return all commands associated with a PROCESS.
Each element will have the form (BACKGROUND FORM PROCESSES), as
returned by `eshell-add-command' (which see).

Usually, there should only be one element in this list, but it's
theoretically possible to have more than one associated command
for a given process."
  (nconc (when (memq process (cadr eshell-foreground-command))
           (list (cons nil eshell-foreground-command)))
         (seq-keep (lambda (cmd)
                     (when (memq process (cadr cmd))
                       (cons 'background cmd)))
                   eshell-background-commands)))