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:
parent
6756e72d88
commit
f76c27cd93
1 changed files with 49 additions and 45 deletions
6
eat.el
6
eat.el
|
@ -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.
|
||||
|
|
Loading…
Add table
Reference in a new issue