From db8a9e233a010a61063f34220821ec76157a2d84 Mon Sep 17 00:00:00 2001 From: ydl7 Date: Tue, 3 Dec 2024 14:17:35 -0500 Subject: [PATCH] Fix control characters appearing in connection file. (#563) * Match only JSON type connection files. --------- Co-authored-by: Yuri D. Lensky --- jupyter-env.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jupyter-env.el b/jupyter-env.el index bf7149c4..4ed9836b 100644 --- a/jupyter-env.el +++ b/jupyter-env.el @@ -165,7 +165,10 @@ The session can be used to write a connection file, see (error "`jupyter kernel` failed to show connection file path")) (and (process-live-p process) (goto-char (point-min)) - (re-search-forward "Connection file: \\(.+\\)\n" nil t))) + (re-search-forward (rx "Connection file: " + (group (+ any) ".json") + (* whitespace) line-end) + nil t))) (let* ((conn-file (concat (save-match-data (file-remote-p default-directory))