pythonic-emacs / anaconda-mode

Code navigation, documentation lookup and completion for Python.
GNU General Public License v3.0
707 stars 87 forks source link

Lift limitation on ssh aliases #387

Open dangom opened 4 years ago

dangom commented 4 years ago

"It is important to remember that remote_host must be a real host name or an IP address. SSH aliases not allowed to be used with anaconda-mode."

Why is this the case and how to make anaconda-mode work with SSH aliases?

cartesian-theatrics commented 4 years ago

managed to get it working with this change:

modified   anaconda-mode.el
@@ -470,7 +470,9 @@ called when `anaconda-mode-port' will be bound."
                                       anaconda-mode-ssh-process-buffer
                                       "ssh" "-nNT"
                                       "-L" (format "%s:localhost:%s" (anaconda-mode-port) (anaconda-mode-port))
-                                      (format "%s@%s" (pythonic-remote-user) (pythonic-remote-host))
+                                      (if (pythonic-remote-user)
+                                          (format "%s@%s" (pythonic-remote-user) (pythonic-remote-host))
+                                        (pythonic-remote-host))
                                       "-p" (number-to-string (or (pythonic-remote-port) 22)))))
                ;; prevent race condition between tunnel setup and first use
                (sleep-for anaconda-mode-tunnel-setup-sleep)

Not sure how robust it is.

Note, I also had to patch pythonic-remote-ssh-p to also check for sshx.