From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#61748: 27.2; Eglot should use shell-file-name when launching the language server for a remote file Date: Fri, 24 Feb 2023 17:44:24 +0100 Message-ID: <87edqff1xz.fsf@gmx.de> References: <1059072250.16834484.1677237084935.JavaMail.root@zimbra60-e10.priv.proxad.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30143"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 61748@debbugs.gnu.org To: jeberger@free.fr Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 24 17:45:16 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 1pVbC8-0007fL-62 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 Feb 2023 17:45:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVbBx-0007hi-D3; Fri, 24 Feb 2023 11:45:05 -0500 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 1pVbBv-0007gF-Ae for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2023 11:45:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVbBu-0006Fs-Lu for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2023 11:45:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pVbBu-0003Jb-HG for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2023 11:45:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 24 Feb 2023 16:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61748 X-GNU-PR-Package: emacs Original-Received: via spool by 61748-submit@debbugs.gnu.org id=B61748.167725707712691 (code B ref 61748); Fri, 24 Feb 2023 16:45:02 +0000 Original-Received: (at 61748) by debbugs.gnu.org; 24 Feb 2023 16:44:37 +0000 Original-Received: from localhost ([127.0.0.1]:38096 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVbBU-0003Ic-Ok for submit@debbugs.gnu.org; Fri, 24 Feb 2023 11:44:37 -0500 Original-Received: from mout.gmx.net ([212.227.15.15]:55941) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVbBS-0003IN-Se for 61748@debbugs.gnu.org; Fri, 24 Feb 2023 11:44:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1677257066; i=michael.albinus@gmx.de; bh=ZR/Zon6WJy2UV1uWDdQ8IWSClI88a0F+V5oLcbYHBGo=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=lodBh/R+4NudSSivLt1P6hIxSyQvhk3EQCiw8Rma7FEItFeIqLn+sBXMtb4K468EW 0Xpmh2q8VhTNYvUGqhzAHoEM51n+8izrlnTqg2DLOF1XN8YX+zyBq63KcxKvgsPEhw DgdlflU+WQ9RMw+phLkiI5jWcN8Fqy2xBmOnvT+lir4WJS63Sa0hy/yZpa9Arkjyln s2u+yfPXG/ijLjfEwNQqR/4mMuSySNdERfyzQpXK/WA0VE+RA0OR1re+u+LUR06sHB nEZScBmcrrlyxUwC1TYg6qWAkOVCp1hifC+Y/l4dad/1ypioUFZ4oh4f1zx3Fbk75m sUv0RDpwvHeJA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from gandalf.gmx.de ([185.89.39.22]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Mg6e4-1orKUB3ijW-00hcrB; Fri, 24 Feb 2023 17:44:25 +0100 In-Reply-To: <1059072250.16834484.1677237084935.JavaMail.root@zimbra60-e10.priv.proxad.net> (jeberger@free.fr's message of "Fri, 24 Feb 2023 12:11:24 +0100 (CET)") X-Provags-ID: V03:K1:SdOm0jk0OUrAuL9OCBv+8GV4bwc1iwL906jzaT1Wr1s8eJMeLkB u3k+TrOr3acVGdx30LiNcocoKuGEjYBhPlvR2NYr5EdqexSze+CQnfur60g/4CAcKqxTCpI ZNXPhBvrwDrmlUhpMvC1Jmg4RDju5FNJ2F3g6qbO2EM1dtEZelZgqI7ThMnah0tWjtfg+9V pGmqbDS3MLFOLfQZ5IL3g== UI-OutboundReport: notjunk:1;M01:P0:9HohxmNH+qE=;soX1uAPOhrRCOWGANQ7vOKq10if FFxgNkePj/PrOEo2MNX8oVLJ11M4QnGus1QuwI6f42eKx68WTpOT+KB78GX+IvBRE0j9yYEHJ mwxn30/EriE3boDP8DasPbd8uKuaWRlKPhcB2EXfKubevmDXXyJ+6kxQ+IdGc7onaFbruynxP ZRz5gxXbynQ+Z68IAmD98u6g8Jj87BzrHUomH/9J/VK5voDvDIAbJbFYu1Pyq49b6ojxkwsMj iTeY7SiYxMxu8DO1+WKlBSDD2V2bM+9JJX8iPaFtAg/VZAoTl5gKQd4d4JBmbblXjQLwLfhuq bf8xk8SsBmlYl/m9QhM4UutGT3hrYbJN+eoJLKjsq2wu5yAPYw6dlCkyxQGbGPPN9zvEjPvR3 EMBUxVSjfL1M+v6uPRoN6Myu3hyF3SJ9GqE4UQ4Ijw9Y6+/D9T4Ea6pAPHbdSgWoR2+JZetJM AecQyJSP5+Xqt0Lv/yvUHfEpo/L8sOKIltirsvGjPXFPR4Nu7W2gDvk/Lvf7l84BWpjIXVL2q zEJd+6QIeNhr/L3jQpxpabVCp3yVCrr6bmsDgcf9j1PihIqC5qhOWbGwTmDq9HxGRfx0AfXf7 5vslY1+vIW4PFRxYjN21uyII5IoysKboGBa322qVl7c4USpq/leuBxAansFHvjAqJ/n8mpEiN GWQZB29hgr4aKcbMZumszrwk6ZjZ4Po3WlfjsSZe1q5xnGbo2xActGr8mZrnhgLx7LmSdfBM0 2KhXzz98Eu8E1o+zWoapa5w+H55nL/DxmMNI5KAIOr4cjIya0EewB+q+5/n/2Claueow6Ct2 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:256635 Archived-At: jeberger@free.fr writes: Hi, >>> # Partial fix >>> >>> The server starts correctly if I change function `eglot--cmd` to use `= (or shell-file-name "sh")` instead of plain `"sh"`, e.g.: >> >> I don't think this is the correct fix. The literal "sh -c" is used in >> Eglot only for remote server invocations, and I presume this was done >> to avoid the problems with running Eglot on MS-Windows. Using >> shell-file-name is incorrect for this use case because shell-file-name >> gives you the name of the _local_ shell. I think we have better ways >> of dealing with this issue' I've CC'ed Michael in the hope that he >> will tell how to solve this properly. >> >> Thanks. > > According to https://www.gnu.org/software/tramp/#Running-shell_002dcomma= nd-on-a-remote-host > `shell-file-name` is also used for _remote_ command invocation and set t= o `/bin/sh` by default. > It can be configured using connection local variables. From the same sou= rce, the fix > should also use `(or shell-command-switch "-c")` instead of plain `"-c"`= . Indeed. Since Tramp 2.4 (Emacs 27), Tramp provides both `shell-file-name` and `shell-command-switch' as connection-local variables. Per default, the former is "/bin/sh" (or "/system/bin/sh" on Android devices). When it is not known, whether a given remote buffer has expanded connection-local variables, the usage pattern might be (with-connection-local-variables shell-file-name) > Cordially. Best regards, Michael.