Function: eshell-with-copied-handles
eshell-with-copied-handles is a macro defined in esh-cmd.el.gz.
Signature
(eshell-with-copied-handles &rest BODY)
Documentation
Copy the current I/O handles and evaluate BODY.
After evaluating BODY, automatically release the handles, allowing them to close.
Aliases
eshell-copy-handles (obsolete since 30.1)
Source Code
;; Defined in /usr/src/emacs/lisp/eshell/esh-cmd.el.gz
(defmacro eshell-with-copied-handles (&rest body)
"Copy the current I/O handles and evaluate BODY.
After evaluating BODY, automatically release the handles, allowing them
to close."
(declare (indent 0))
`(let ((eshell-current-handles
(eshell-duplicate-handles eshell-current-handles)))
(unwind-protect
,(if (length= body 1) (car body) `(progn ,@body))
(eshell-close-handles))))