GNU bug report logs - #54885
29.0.50; Tramp completion support for top-level sshconfig include

Previous Next

Package: emacs;

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Bartosz Kaczyński <bk <at> asterio.cloud>
Cc: 54885 <at> debbugs.gnu.org
Subject: bug#54885: 29.0.50; Tramp completion support for top-level sshconfig include
Date: Wed, 13 Apr 2022 09:13:59 +0200
Bartosz Kaczyński <bk <at> asterio.cloud> writes:

Hi Bartosz,

> Hi, I noticed that TRAMP hostname complation doesn't support my
> top-level sshconfig like below:
>
> tree ~/.ssh/conf.d/
> /home/bk/.ssh/conf.d/
> ├── domainX
> ├── domainY
> └── personal
>
> My ~/.ssh/config contains only one line
>
> Include conf.d/*
>
> and it's work perfectly from the shell by Emacs can't parse this
> Include directive. It would be very useful enhancement if the built-in
> completion frameworks (I use icomplete with vertical mode) can handle
> that structure which I first saw on counsel-tramp package(1).
>
> 1. https://github.com/masasam/emacs-counsel-tramp#support-for-top-level-sshconfig-include

Tramp doesn't handle sshconfig includes. However, you can emulate it
yourself with the following snippet in your .emacs (untested):

--8<---------------cut here---------------start------------->8---
(defvar my-tramp-completion-function-alist-ssh nil)

(dolist (file (directory-files "~/.ssh/conf.d/" 'full directory-files-no-dot-files-regexp))
  (add-to-list 'my-tramp-completion-function-alist-ssh
	       `(tramp-parse-sconfig ,file)))

(tramp-set-completion-function "scp" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "ssh" tramp-completion-function-alist-ssh)
--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.