From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii 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 10:15:52 +0200 Message-ID: <83ttzbo4w7.fsf@gnu.org> References: <774021794.15662399.1677224385920.JavaMail.root@zimbra60-e10.priv.proxad.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6149"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 61748@debbugs.gnu.org To: jeberger@free.fr, Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 24 09:17:20 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 1pVTGZ-0001LX-CY for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 Feb 2023 09:17:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVTGN-0004XC-7Q; Fri, 24 Feb 2023 03:17:07 -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 1pVTGJ-0004VD-JN for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2023 03:17: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 1pVTGI-0000l0-Mw for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2023 03:17:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pVTGI-0004a3-6Q for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2023 03:17:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 24 Feb 2023 08:17: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.167722657217541 (code B ref 61748); Fri, 24 Feb 2023 08:17:02 +0000 Original-Received: (at 61748) by debbugs.gnu.org; 24 Feb 2023 08:16:12 +0000 Original-Received: from localhost ([127.0.0.1]:35934 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVTFU-0004Yq-03 for submit@debbugs.gnu.org; Fri, 24 Feb 2023 03:16:12 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVTFR-0004Ya-Kv for 61748@debbugs.gnu.org; Fri, 24 Feb 2023 03:16:10 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pVTFL-0000aD-TB; Fri, 24 Feb 2023 03:16:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Vvc0YdBZfqNo2CBLfZKGIH2pi9iimvXYDSqCiG00olc=; b=oj6tAMpZJvUo 3oYNYEv+KHL0BOAhfuDRHQ99WQRP7fGhhKt6v7VBrLGcNO9bto6DBa7VbyBXC+er2Ul6IojOlZiQ1 HsnbUA8XReSjp5G6K+/2Ydc7Nw9FAotWOQh8v0KglKinDjwpPGflVS3obu25x2GfY1oIn+9VyHVeC dOQDVE0F+tUwMCLKn6dluKwO/BtUm0s5s4z9YTCwWyf9ZLrqEVtb2MouhPyCEHFC6SL+wIrpBh/MK jopIhCN20B0KknOU4BJcceMXErexZ72bvDPbtP+k7a58TBrJO2m3zSY0oLLAeXIy+Sr8XGbAhnfmI XrNBBXQoXu1zyeg1KKLRsw==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pVTFB-0000Xm-D4; Fri, 24 Feb 2023 03:15:56 -0500 In-Reply-To: <774021794.15662399.1677224385920.JavaMail.root@zimbra60-e10.priv.proxad.net> (jeberger@free.fr) 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:256553 Archived-At: > Date: Fri, 24 Feb 2023 08:39:45 +0100 (CET) > From: jeberger@free.fr > > >From https://github.com/joaotavora/eglot/issues/1175 > > # Steps to reproduce: > > - On the remote machine: > - Install a language server in a non-standard path (e.g. `rust-analyzer`, which installs in a subdirectory under `$HOME` and not `/usr/bin`) > - Make sure that the server is in the path for a shell other than `sh` (e.g. set the path in `.zprofile` for `zsh`). > - On the local machine: > - Open a file remotely through TRAMP > - Set `shell-file-name` to the shell you're using on the remote (e.g. `(setq shell-file-name "zsh")`) > - M-x `eglot`. > > # Expected result: > > Eglot should start > > # Actual result: > > Eglot asks `Enter program to execute (or :):`, then when I type `rust-analyzer` it fails with message `[jsonrpc] Server exited with status 127`. Looking at `eglot-events-buffer`, it is clear that eglot tried to use `sh` to start the server. > > # 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.