Use 'kill-process' as a fallback when a pipe gets broken in Eshell
authorJim Porter <jporterbugs@gmail.com>
Sun, 14 Jul 2024 23:51:43 +0000 (16:51 -0700)
committerJim Porter <jporterbugs@gmail.com>
Sat, 27 Jul 2024 19:10:33 +0000 (12:10 -0700)
This is better than 'delete-process' since it will ensure that any
stderr pipe-processes get stopped as well (bug#72117).

* lisp/eshell/esh-proc.el (eshell-insertion-filter): Use 'kill-process'
instead of 'delete-process'.

lisp/eshell/esh-proc.el

index 2ff41c3d409baf0cb0e72ff1f025317988eab8f4..f3a099885bb3142730855c169dd4a277f8bef8a1 100644 (file)
@@ -483,7 +483,7 @@ output."
                   ;; here.  However, remote processes don't currently
                   ;; support that, and not all systems have SIGPIPE in
                   ;; the first place (e.g. MS Windows).  In these
-                  ;; cases, just delete the process; this is
+                  ;; cases, just kill the process; this is
                   ;; reasonably close to the right behavior, since the
                   ;; default action for SIGPIPE is to terminate the
                   ;; process.  For use cases where SIGPIPE is truly
@@ -493,7 +493,7 @@ output."
                   (eshell-pipe-broken
                    (if (or (process-get proc 'remote-pid)
                            (eq system-type 'windows-nt))
-                       (delete-process proc)
+                       (kill-process proc)
                      (signal-process proc 'SIGPIPE))))))
                 (process-put proc :eshell-busy nil))))))