Fix pre- and post-command-hook errors in term.el
Before this patch, after the terminal process dies the command hooks added in term-mode's char mode would produce errors. This fix removes these hooks when the process dies. * lisp/term.el (term-handle-exit): Remove pre-command-hook and post-command-hook because the process is dead. (Bug#31236) Copyright-paperwork-exempt: yes
This commit is contained in:
parent
6cf83131e2
commit
d6e2c59318
1 changed files with 3 additions and 0 deletions
|
@ -1484,6 +1484,9 @@ The main purpose is to get rid of the local keymap."
|
||||||
(let ((buffer-read-only nil)
|
(let ((buffer-read-only nil)
|
||||||
(omax (point-max))
|
(omax (point-max))
|
||||||
(opoint (point)))
|
(opoint (point)))
|
||||||
|
;; Remove hooks to avoid errors due to dead process.
|
||||||
|
(remove-hook 'pre-command-hook #'term-set-goto-process-mark t)
|
||||||
|
(remove-hook 'post-command-hook #'term-goto-process-mark-maybe t)
|
||||||
;; Record where we put the message, so we can ignore it
|
;; Record where we put the message, so we can ignore it
|
||||||
;; later on.
|
;; later on.
|
||||||
(goto-char omax)
|
(goto-char omax)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue