From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ko Nishi Newsgroups: gmane.emacs.bugs Subject: bug#66093: Eglot over tramp sshfs/sftp Date: Tue, 19 Sep 2023 20:59:06 +0200 Message-ID: References: <878r92wqpf.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22668"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 66093@debbugs.gnu.org, joaotavora@gmail.com To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 20 03:41:17 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qimDM-0005iq-En for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 20 Sep 2023 03:41:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qimD9-0003Ir-6z; Tue, 19 Sep 2023 21:41:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qimD1-0003Hv-K6 for bug-gnu-emacs@gnu.org; Tue, 19 Sep 2023 21:40:57 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qimD0-0007vl-6H for bug-gnu-emacs@gnu.org; Tue, 19 Sep 2023 21:40:55 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qimD9-0001lu-8l for bug-gnu-emacs@gnu.org; Tue, 19 Sep 2023 21:41:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ko Nishi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Sep 2023 01:41:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66093 X-GNU-PR-Package: emacs Original-Received: via spool by 66093-submit@debbugs.gnu.org id=B66093.16951740216714 (code B ref 66093); Wed, 20 Sep 2023 01:41:03 +0000 Original-Received: (at 66093) by debbugs.gnu.org; 20 Sep 2023 01:40:21 +0000 Original-Received: from localhost ([127.0.0.1]:57966 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qimCR-0001k5-Py for submit@debbugs.gnu.org; Tue, 19 Sep 2023 21:40:21 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]:53953) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qifwQ-0007fp-L5 for 66093@debbugs.gnu.org; Tue, 19 Sep 2023 14:59:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.com; s=s31663417; t=1695149946; x=1695754746; i=kohnish@gmx.com; bh=2LRa3IUv54hsOq4FTSfDlupY4WYW4bgLMNt9NnuiV2Y=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=UupAAcnTSsg6h1yVhrvQ9np2pCLc0IZX887GtiOt8O6QYiZZdHy0TlSyC39FMv60nwtvFu9ECT6 hpXUtMEwfwIiGJ1sdqAgdicrmKiw2aUc5K/dnHU3OZInEDi5mvSGh5pCJ64KHfL9gK46Z950UP3Bb dvDJm1fHbmrmfXGykOmpbf7gYS4SLUqqMtddq3Q84KLvtvZGhVconEabM6v8q9mlgvA3jo4qivzdB Aw39q4NpbjGPxrr9ICureP1B9KS7e0Ysd3Uuc7eU4P58pfIcxL7wDisXUL33IWds7CqAnK6uhejqk 6A+BoQJfle352QW4KZzY/SY+a8N5KhHIk1NA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from [89.205.142.42] ([89.205.142.42]) by web-mail.gmx.net (3c-app-mailcom-bs15.server.lan [172.19.170.183]) (via HTTP); Tue, 19 Sep 2023 20:59:06 +0200 Importance: normal Sensitivity: Normal In-Reply-To: <878r92wqpf.fsf@gmx.de> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:HAeMCx2epNFZlgLOe9Vw9O5kY8apXCOjbkmLsB4gkHJ92CB2J76mdN2VP4ChiGv7bnXi2 rfKO09YxP+gMSmw6SCveFbdZdKISn8L08oYsDkay9mbmURc7CU7kWbp4T/0YaLw4tyybuwEDnE+5 TWrDHi+og8HS2DU1BEJCcy+d0BKyGeY0UDxsIvxe6WvRdXPrZINs9hyk733r3XZbpcuJxh5qHSvC rSWrye3gBzCwpZQdgdinGopBiFZLQBg658gtL2+qdcHiTDXFgsaUh7lvXy4liJ5xq0/Lk/YMmujg CQ= UI-OutboundReport: notjunk:1;M01:P0:78ki+3IEwbI=;kl5uM7uNGmE5fVsTr3M/Uofif+s 5Pv7SQCYGNAyc9wbcRvfhuLGEH0fYDqbQPVHidpP7Mz2xfu71GWqpg23jseFD4EI08MfocDHb rykCY3HAq1xlupn2Xh9K0YkAm8TsZj0QjK+wkYFqqLOHxQUVTX/ec0A3ctUCnMLRmJjvSUSKz gTLFFZtgt9Ivbb5KKMh4IEOB9z9mcdPtnR9XLalnEHyXPajSxuGxtguL5lYy6xAlFoPnPVLk+ T4/qx09mL/LW/Xwiioy9qYsqU2TuoAtQ80T+0T+iTafXlcNDKBg2Q2jofnCKA/m1ZismW2Q1K secr37CkSQgyetc46VRzjs3IxSp4uAZSUBmF58hpwnszbvs3QoTHkjyvBzo4DPqcHKy/dLN/o Efou8jYb5LYTIRAfR7Ng8Roe/7+os5D/2Pg3TTj/JF+l3bN4W3YmyjfnCDfNFlXEZrct/6KCK Fmhfi4BHmxX0IsU3vlxioIQGNFFiE2uN1M4OUZxwTxTtLkyGh7mSwzQA3O4LNZLK7WwtYznNs XHR3aNjyseV13ot3BkX4whkLEV16XlcZcJWfdq+6zz8O/tuOSy6vg9BWWyKwL4N5HXRNUo8sM 7vIDbBXcpRDe/KHwFSmORc8yFgxyWIXOBb3q8YlCrn4zBKQcHNHvkzNO01We0aZMKeRxf1g2V W1zcw5jKZ955QOiUksD5Ebucz5qGvCC0vEF5Bmk9MX43CxQd7+nujB/W1BLHE0l+/T0jVJ5UQ AnfXMc11LMm48ZhCMi8DJT9QME0auswa57u3qwrAq2Ly9tluX2TweHp7GgCeurFJRmalTiVZ X-Mailman-Approved-At: Tue, 19 Sep 2023 21:40:16 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:270899 Archived-At:
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" <michael.albinus@gmx.de>
To: "Ko Nishi" <kohnish@gmx.com>
Cc: 66093@debbugs.gnu.org, joaotavora@gmail.com
Subject: Re: bug#66093: Eglot over tramp sshfs/sftp
Ko Nishi <kohnish@gmx.com> 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.