Michael Albinus <[email protected]> writes:

Hi Jim,

>> [1] At least for sshx, my understanding is that this would only happen
>> if you had the connection info cached in ~/.emacs.d/tramp, so you
>> wouldn't see this with "emacs -Q" even with my patch to fix things. It
>> would matter in everyday usage though.
>
> Hmm, strange. Tramp knows several places to grab host names for
> completion, for example ~/.ssh/config and ~/.ssh/known_hosts. Doesn't
> this work for you?

Well, I've googled around, and it looks that the ssh server and client
directories on MS Windows are c:/ProgramData/ssh and
c:/Users/<user>/.ssh, see
https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_server_configuration
https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_keymanagement

Does the appended patch help for host name completion?

Best regards, Michael.

*** /tmp/ediff4KUWha	2021-04-09 13:31:52.569187360 +0200
--- /home/albinus/src/tramp/lisp/tramp-sh.el	2021-04-09 13:31:07.195298075 +0200
***************
*** 401,416 ****

  ;;;###tramp-autoload
  (defconst tramp-completion-function-alist-ssh
!   '((tramp-parse-rhosts      "/etc/hosts.equiv")
      (tramp-parse-rhosts      "/etc/shosts.equiv")
!     (tramp-parse-shosts      "/etc/ssh_known_hosts")
!     (tramp-parse-sconfig     "/etc/ssh_config")
      (tramp-parse-shostkeys   "/etc/ssh2/hostkeys")
      (tramp-parse-sknownhosts "/etc/ssh2/knownhosts")
      (tramp-parse-rhosts      "~/.rhosts")
      (tramp-parse-rhosts      "~/.shosts")
!     (tramp-parse-shosts      "~/.ssh/known_hosts")
!     (tramp-parse-sconfig     "~/.ssh/config")
      (tramp-parse-shostkeys   "~/.ssh2/hostkeys")
      (tramp-parse-sknownhosts "~/.ssh2/knownhosts"))
    "Default list of (FUNCTION FILE) pairs to be examined for ssh methods.")
--- 401,430 ----

  ;;;###tramp-autoload
  (defconst tramp-completion-function-alist-ssh
!   `((tramp-parse-rhosts      "/etc/hosts.equiv")
      (tramp-parse-rhosts      "/etc/shosts.equiv")
!     ;; On W32 systems, the sshd directory is located somewhere else.
!     (tramp-parse-shosts      ,(if (getenv "ProgramData")
! 				  (expand-file-name
! 				   "ssh/known_hosts" (getenv "ProgramData"))
! 				"/etc/ssh_known_hosts"))
!     (tramp-parse-sconfig     ,(if (getenv "ProgramData")
! 				  (expand-file-name
! 				   "ssh/config" (getenv "ProgramData"))
! 				"/etc/ssh_config"))
      (tramp-parse-shostkeys   "/etc/ssh2/hostkeys")
      (tramp-parse-sknownhosts "/etc/ssh2/knownhosts")
      (tramp-parse-rhosts      "~/.rhosts")
      (tramp-parse-rhosts      "~/.shosts")
!     ;; On W32 systems, the .ssh directory is located somewhere else.
!     (tramp-parse-shosts      ,(if (getenv "USERPROFILE")
! 				  (expand-file-name
! 				   ".ssh/known_hosts" (getenv "USERPROFILE"))
! 				"~/.ssh/known_hosts"))
!     (tramp-parse-sconfig     ,(if (getenv "USERPROFILE")
! 				  (expand-file-name
! 				   ".ssh/config" (getenv "USERPROFILE"))
! 				"~/.ssh/config"))
      (tramp-parse-shostkeys   "~/.ssh2/hostkeys")
      (tramp-parse-sknownhosts "~/.ssh2/knownhosts"))
    "Default list of (FUNCTION FILE) pairs to be examined for ssh methods.")

Reply via email to