GNU bug report logs -
#54885
29.0.50; Tramp completion support for top-level sshconfig include
Previous Next
Reported by: Bartosz Kaczyński <bk <at> asterio.cloud>
Date: Tue, 12 Apr 2022 14:24:02 UTC
Severity: wishlist
Tags: moreinfo
Found in version 29.0.50
Fixed in version 29.1
Done: Michael Albinus <michael.albinus <at> gmx.de>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Hi Michael,
thank you. These few lines made my work lot easier and it's huge
improvement.
Best regards, Bartosz.
On 4/13/22 16:44, Michael Albinus wrote:
> Michael Albinus <michael.albinus <at> gmx.de> writes:
>
> Hi Bartosz,
>
>> Tramp doesn't handle sshconfig includes. However, you can emulate it
>> yourself with the following snippet in your .emacs (untested):
> Hmm, there was an error in the snipptet. I've reworked it, and added to
> the Tramp manual (pushed to master):
>
> --8<---------------cut here---------------start------------->8---
> 4.18.1 Using ssh config include for host name completion
> --------------------------------------------------------
>
> OpenSSH configuration files can use an ‘Include’ option for further
> configuration files. Default TRAMP host name completion ignores this
> option. However, you can configure this yourself.
>
> Given, your ‘~/.ssh/config’ file contains the following option:
>
> Include ~/.ssh/conf.d/*
>
> The following code snippet in your ‘.emacs’ uses all files in that
> directory for host name completion:
>
> (tramp-set-completion-function
> "ssh" (append (tramp-get-completion-function "ssh")
> (mapcar (lambda (file) `(tramp-parse-sconfig ,file))
> (directory-files
> "~/.ssh/conf.d/"
> 'full directory-files-no-dot-files-regexp))))
>
> This code snippet does it for the ‘ssh’ method. If you replace
> "ssh" by "scp", it does it also for that method (or any other method
> you like).
> --8<---------------cut here---------------end--------------->8---
>
> Best regards, Michael.
This bug report was last modified 3 years and 132 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.