Don't intercept background processes in Eshell

* eat.el (eat--eshell-adjust-make-process-args): Don't do any
change to the environment if 'eshell-current-subjob-p' is
non-nil.
This commit is contained in:
Akib Azmain Turja 2022-12-12 10:22:14 +06:00
parent 6756e72d88
commit f76c27cd93
No known key found for this signature in database
GPG key ID: 5535FCF54D88616B

6
eat.el
View file

@ -5474,6 +5474,8 @@ PROGRAM can be a shell command."
(eat--eshell-cleanup))))
(eshell-sentinel process message))
(defvar eshell-current-subjob-p) ; In `esh-proc'.
;; HACK: This is a dirty hack, it can break easily.
(defun eat--eshell-adjust-make-process-args (fn command args)
"Setup an environment to adjust `make-process' arguments.
@ -5481,6 +5483,8 @@ PROGRAM can be a shell command."
Call FN with COMMAND and ARGS, and whenever `make-process' is called,
modify its argument to change the filter, the sentinel and invoke
`stty' from the new process."
(if eshell-current-subjob-p
(funcall fn command args)
(cl-letf*
(;; For Emacs 29 and above.
(make-process (symbol-function #'make-process))
@ -5527,7 +5531,7 @@ sane 2>%s ; if [ $1 = .. ]; then shift; fi; exec \"$@\""
(progn
(add-hook 'eshell-exec-hook hook 99)
(funcall fn command args))
(remove-hook 'eshell-exec-hook hook)))))
(remove-hook 'eshell-exec-hook hook))))))
;;;;; Minor Modes.