Skip to content

Commit 8f2221f

Browse files
committed
Don't lose the CIDER session over TRAMP files
Fixes #3250
1 parent 9d2aa2c commit 8f2221f

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
- [#3402](https://github.com/clojure-emacs/cider/issues/3402): fix `cider-format-connection-params` edge case for Emacs 29.
2626
- [#3393](https://github.com/clojure-emacs/cider/issues/3393): Recompute namespace info on each shadow-cljs recompilation or evaluation.
2727
- Recompute namespace info on each fighweel-main recompilation.
28+
- [#3250](https://github.com/clojure-emacs/cider/issues/3250): don't lose the CIDER session over TRAMP files.
2829
- Fix the `xref-find-definitions` CIDER backend to return correct filenames.
2930
- Fix the `cider-xref-fn-deps` buttons to direct to the right file.
3031
- Make TRAMP functionality work when using non-standard ports.

cider-connection.el

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,8 @@ REPL defaults to the current REPL."
624624
(when (string-match-p "#uzip" file)
625625
(let ((avfs-path (directory-file-name (expand-file-name (or (getenv "AVFSBASE") "~/.avfs/")))))
626626
(setq file (replace-regexp-in-string avfs-path "" file t t))))
627+
(when-let ((tp (cider-tramp-prefix (current-buffer))))
628+
(setq file (string-remove-prefix tp file)))
627629
(when (process-live-p proc)
628630
(let* ((classpath (or (process-get proc :cached-classpath)
629631
(let ((cp (with-current-buffer repl

test/cider-common-tests.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
(expect (cider-make-tramp-prefix "ssh" "cider-devs" "192.168.50.9#22")
7373
:to-equal "/ssh:cider-devs@192.168.50.9#22:")
7474
(expect (cider-make-tramp-prefix "ssh" "cider-devs" "192.168.50.9")
75-
:to-equal "/ssh:cider-devs@192.168.50.9#22:")
75+
:to-equal "/ssh:cider-devs@192.168.50.9:")
7676
(expect (cider-make-tramp-prefix "ssh" "cider-devs" "192.168.50.9" "12345")
7777
:to-equal "/ssh:cider-devs@192.168.50.9#12345:")
7878
(expect (cider-make-tramp-prefix "ssh" "cider-devs" "192.168.50.9#12345")

0 commit comments

Comments
 (0)