Skip to content

Commit 3736ae7

Browse files
committed
Prevent leaking ANSI sequences when inserting text/plain results
* jupyter-mime.el (jupyter-insert): Do it.
1 parent 2e86892 commit 3736ae7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

jupyter-mime.el

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,9 @@ width and height of the image."
549549

550550
(cl-defmethod jupyter-insert ((_mime (eql :text/plain)) data
551551
&optional _metadata)
552+
;; Reset the context so that it doesn't leak into DATA if DATA has
553+
;; no ANSI sequences.
554+
(setq ansi-color-context nil)
552555
(jupyter-insert-ansi-coded-text data)
553556
(insert "\n"))
554557

0 commit comments

Comments
 (0)