Subject: bug#66093: Eglot over tramp sshfs/sftp

From: Ko Nishi <[email-masked]>
Date: Tue, 19 Sep 2023 20:59:06 +0200

Hi Michael,

Thanks for the prompt response.

> Tramp's sftp integration doesn't support remote processes. So there's no
> chance to make it working.

Got it. It's a pity, gvfs-sftp feel snappier than sshfs on initial connection.

> I'm not sure, but likely the snippet "stty\ raw\ \>\ /dev/null\;\ /usr/bin/clangd"
> might need another quoting.

Without really understanding the code, If I copy the list from the ssh section of tramp-sh.el:245 and remove ("%c"), it started work after manually telling eglot to start clangd manually on propmt.

Eglot is noticeably faster than using just ssh or sshx on a server 80ms ping away.

I think it'll be great for many people if there is one cross-platform network filesystem + remote command support, like SMB + ssh.

But first sshfs.

Other than that many other things aren't working like vc-root-dir, finding PATH and etc.

I'll try to understand the code and play around later.

Best,

Ko

Sent: Tuesday, September 19, 2023 at 9:46 AM
From: "Michael Albinus" <[email-masked]>
To: "Ko Nishi" <[email-masked]>
Cc: [email-masked], [email-masked]
Subject: Re: bug#66093: Eglot over tramp sshfs/sftp

Ko Nishi <[email-masked]> writes:

> Hi,

Hi Ko,

> I was suggested to contact here from a github discussion
> https://github.com/joaotavora/eglot/discussions/1294.
> But in short, at the moment, eglot fails to spawn a functioning
> language server process over tramp when sshfs or sftp is used.
> For sshfs, I see clangd process without stty command on remote, while
> with sftp eglot doesn't find the path.

Tramp's sftp integration doesn't support remote processes. So there's no
chance to make it working.

sshfs, as general concept, doesn't allow remote processes either. Tramp
has added this functionality by opening a parallel ssh connection, see
tramp-sshfs.el for its configuration (the lines, where
tramp-sshfs-method is added to tramp-methods). However, it calls remote
commands directly via ssh, like this (according to Tramp traces):

--8<---------------cut here---------------start------------->8---
ssh -q -e none -t -t gandalf cd /home/albinus/src/emacs/ && ( env INSIDE_EMACS\=30.0.50\,tramp\:2.7.0-pre ENV\=\'\' TMOUT\=0 LC_CTYPE\=\'\' CDPATH\= HISTORY\= MAIL\= MAILCHECK\= MAILPATH\= PAGER\=cat autocorrect\= correct\= /bin/sh -c stty\ raw\ \>\ /dev/null\;\ /usr/bin/clangd )
--8<---------------cut here---------------end--------------->8---

I'm not sure, but likely the snippet "stty\ raw\ \>\ /dev/null\;\ /usr/bin/clangd"
might need another quoting.

> Best regards,
> Ko

Best regards, Michael.