From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: jeberger@free.fr 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 08:39:45 +0100 (CET) Message-ID: <774021794.15662399.1677224385920.JavaMail.root@zimbra60-e10.priv.proxad.net> References: <1909672588.15608265.1677223717877.JavaMail.root@zimbra60-e10.priv.proxad.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19442"; mail-complaints-to="usenet@ciao.gmane.io" To: 61748@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 24 08:40:29 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 1pVSgv-0004sU-9Y for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 Feb 2023 08:40:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVSgi-0007hO-W2; Fri, 24 Feb 2023 02:40:17 -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 1pVSgd-0007Xd-HJ for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2023 02:40:11 -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 1pVSgU-0006v2-LG for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2023 02:40:11 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pVSgU-0003f7-0k for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2023 02:40:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: jeberger@free.fr Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 24 Feb 2023 07:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 61748 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.167722439914063 (code B ref -1); Fri, 24 Feb 2023 07:40:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 24 Feb 2023 07:39:59 +0000 Original-Received: from localhost ([127.0.0.1]:35900 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVSgQ-0003ek-Li for submit@debbugs.gnu.org; Fri, 24 Feb 2023 02:39:59 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:41548) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVSgO-0003ec-By for submit@debbugs.gnu.org; Fri, 24 Feb 2023 02:39:57 -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 1pVSgM-00071n-Ej for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2023 02:39:55 -0500 Original-Received: from smtp5-g21.free.fr ([2a01:e0c:1:1599::14]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pVSgJ-0006tV-BS for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2023 02:39:53 -0500 Original-Received: from zimbra60-e10.priv.proxad.net (unknown [172.20.243.210]) by smtp5-g21.free.fr (Postfix) with ESMTP id 19DC75FFA1; Fri, 24 Feb 2023 08:39:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=free.fr; s=smtp-20201208; t=1677224386; bh=UuqbjoJqdzoioruXPzTQEODa19LYjNLp+jzZBHCFhqI=; h=Date:From:To:In-Reply-To:Subject:From; b=S2AT3RKWyFqX/KAIll++h0wVYKz0/2h/VcnP4SS+44UT3P4oX6qgch1kTk1IwGPdw mUBY5kxyBMfkK7PHL62QUiR7geztuRczHt2i9fHXcoOG7nxBHPXVHt5y0L+1CMr3Is RXq8TGRQqucLuqoLuMOp0WDMWb74umrMlAuWcJ1FBR+wt+uISGDGmoiLHJGANwKzrS Ndt/jpNtH0ENXMGGF4Y8DO7WEhW5gm9nc6hMvfEdjHi52T+g2087yeH2eesiKjxWjG /Yzh/MPBw+Zj3kITK5DtbVktS98p6WrIix4ptdPWOSDecJMCtcEQrp7+q32QKajbYd GxtkaGOsmVCSg== In-Reply-To: <1909672588.15608265.1677223717877.JavaMail.root@zimbra60-e10.priv.proxad.net> X-Originating-IP: [193.240.154.120] X-Mailer: Zimbra 7.2.0-GA2598 (ZimbraWebClient - NAV6 (Win)/7.2.0-GA2598) X-Authenticated-User: jeberger@free.fr Received-SPF: pass client-ip=2a01:e0c:1:1599::14; envelope-from=jeberger@free.fr; helo=smtp5-g21.free.fr X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:256551 Archived-At: >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 us= e `sh` to start the server. # Partial fix The server starts correctly if I change function `eglot--cmd` to use `(or s= hell-file-name "sh")` instead of plain `"sh"`, e.g.: ```lisp (defun eglot--cmd (contact) "Helper for `eglot--connect'." (if (file-remote-p default-directory) ;; TODO: this seems like a bug, although it=E2=80=99s everywhere. For ;; some reason, for remote connections only, over a pipe, we ;; need to turn off line buffering on the tty. ;; ;; Not only does this seem like there should be a better way, ;; but it almost certainly doesn=E2=80=99t work on non-unix systems. (list (or shell-file-name "sh") "-c" (string-join (cons "stty raw > /dev/null;" (mapcar #'shell-quote-argument contact)) " ")) contact)) ``` It still fails to autodetect the server and asks for the program to execute= though. ---- In GNU Emacs 27.2 (build 1, x86_64-w64-mingw32) of 2021-03-26 built on CIRROCUMULUS Repository revision: deef5efafb70f4b171265b896505b92b6eef24e6 Repository branch: HEAD Windowing system distributor 'Microsoft Corp.', version 10.0.19042 System Description: Microsoft Windows 10 Enterprise (v10.0.2009.19042.2604) Recent messages: Cleaning up the recentf list...done (0 removed) Quit Cleaning up the recentf list...done (0 removed) Timer #[257 "\303=01!\205!\0r\211q\210=08\203=1D\0=09\203=1D\0\304\305\306\= 307=09$\210\310\311!\210\312\211=12)\207" [flymake-mode flymake-no-changes-= timeout flymake-timer buffer-live-p flymake--log-1 :debug flymake "starting= syntax check after idle for %s seconds" flymake-start t nil] 6 " (fn BUFFER)"] ran for 00:00:17 from 08:15:39 to 08:15:56 Couldn=E2=80=99t find local shell prompt for C:/ProgramData/chocolatey/lib/= Emacs/tools/emacs/libexec/emacs/27.2/x86_64-w64-mingw32/cmdproxy.exe Cleaning up the recentf list...done (0 removed) Timer flycheck--handle-idle-trigger ran for 00:00:49 from 08:15:38 to 08:16= :27 Auto-saving... Configured using: 'configure --without-dbus --host=3Dx86_64-w64-mingw32 --without-compress-install 'CFLAGS=3D-O2 -static'' Configured features: XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY W32NOTIFY ACL GNUTLS LIBXML2 HARFBUZZ ZLIB TOOLKIT_SCROLL_BARS MODULES THREADS JSON PDUMPER LCMS2 GMP Important settings: value of $LANG: FRA locale-coding-system: cp1252 Major mode: Rust Minor modes in effect: flymake-mode: t flycheck-mode: t desktop-save-mode: t rainbow-delimiters-mode: t which-function-mode: t shell-dirtrack-mode: t recentf-mode: t global-linum-mode: t linum-mode: t global-hl-line-mode: t global-leerzeichen-mode: t yas-global-mode: t yas-minor-mode: t ws-butler-global-mode: t ws-butler-mode: t global-whitespace-mode: t tabbar-mwheel-mode: t tabbar-mode: t global-semanticdb-minor-mode: t global-semantic-idle-scheduler-mode: t global-semantic-idle-local-symbol-highlight-mode: t global-semantic-idle-summary-mode: t global-semantic-highlight-func-mode: t semantic-mode: t phi-rectangle-mode: t ivy-mode: t highlight-doxygen-global-mode: t global-dash-fontify-mode: t global-company-mode: t company-mode: t bar-cursor-mode: t override-global-mode: t show-paren-mode: t delete-selection-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: d:/home/.emacs.d/elpa/jsonrpc-1.0.16/jsonrpc hides c:/ProgramData/chocolate= y/lib/Emacs/tools/emacs/share/emacs/27.2/lisp/jsonrpc d:/home/.emacs.d/elpa/xref-1.6.2/xref hides c:/ProgramData/chocolatey/lib/E= macs/tools/emacs/share/emacs/27.2/lisp/progmodes/xref d:/home/.emacs.d/elpa/project-0.9.8/project hides c:/ProgramData/chocolatey= /lib/Emacs/tools/emacs/share/emacs/27.2/lisp/progmodes/project d:/home/.emacs.d/elpa/flymake-1.2.2/flymake hides c:/ProgramData/chocolatey= /lib/Emacs/tools/emacs/share/emacs/27.2/lisp/progmodes/flymake d:/home/.emacs.d/packages/mpuz hides c:/ProgramData/chocolatey/lib/Emacs/to= ols/emacs/share/emacs/27.2/lisp/play/mpuz d:/home/.emacs.d/elpa/seq-2.23/seq hides c:/ProgramData/chocolatey/lib/Emac= s/tools/emacs/share/emacs/27.2/lisp/emacs-lisp/seq d:/home/.emacs.d/elpa/eldoc-1.13.0/eldoc hides c:/ProgramData/chocolatey/li= b/Emacs/tools/emacs/share/emacs/27.2/lisp/emacs-lisp/eldoc Features: (shadow sort mail-extr emacsbug message rmc rfc822 mml mml-sec epa mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail tramp-cmds counsel-gtags minimal-session-saver css-mode sgml-mode eww mm-url gnus nnheader gnus-util rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums mail-utils mm-util mail-prsvr url-queue url url-proxy url-privacy url-expand url-methods url-history mailcap shr text-property-search url-cookie url-domsuf puny svg xml dom ffap eieio-opt semantic/sb speedbar sb-image dframe eglot external-completion array filenotify jsonrpc ert ewoc debug backtrace flymake-proc flymake warnings url-util cl-print help-fns radix-tree web-mode bitbake mmm-mode mmm-univ mmm-class mmm-region mmm-auto mmm-vars mmm-utils mmm-compat markdown-mode yaml-mode python sh-script smie executable semantic/bovine/make semantic/bovine/make-by make-mode toml-mode conf-mode racer f etags fileloop generator add-log semantic/tag-file semantic/imenu semantic/db-file data-debug cedet-files semantic/bovine/c semantic/decorate/include semantic/decorate/mode semantic/decorate semantic/bovine/c-by semantic/lex-spp semantic/bovine/gcc semantic/dep semantic/bovine semantic/analyze/refs semantic/db-find semantic/db-ref hideif hideshow jb-prog-licences jb-prog-font align jb-cc-mode cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs flycheck-rust flycheck rust-utils rust-mode rust-rustfmt rust-playpen rust-compile rust-cargo tramp-cache vc-dispatcher vc-hg diff-mode desktop frameset thingatpt counsel xdg xref project dired dired-loaddefs swiper matlab matlab-scan matlab-syntax matlab-compat pulse rainbow-delimiters windmove s server ibuf-macs which-func imenu tramp-sh tramp tramp-loaddefs trampver tramp-integration files-x tramp-compat shell pcomplete parse-time iso8601 time-date format-spec recentf tree-widget linum hl-line leerzeichen yasnippet ws-butler cus-edit wid-edit whitespace tabbar smart-mode-line-light-theme smart-mode-line rich-minority semantic/db-mode semantic/idle semantic/analyze semantic/sort semantic/scope semantic/analyze/fcn semantic/db eieio-base semantic/format ezimage semantic/tag-ls semantic/find semantic/ctxt semantic/util-modes semantic/util semantic pp semantic/tag semantic/lex semantic/fw mode-local find-func cedet phi-rectangle rect kconfig-mode derived ivy-hydra hydra lv ivy ivy-faces ivy-overlay colir color flx avy ht highlight-doxygen noutline outline dash company-oddmuse company-files company-capf company-cmake company-clang company-semantic company-css company-nxml company-bbdb company-keywords company-gtags company-template company-dabbrev-code company-dabbrev company pcase bar-cursor peg cl-extra help-mode advice use-package use-package-ensure use-package-delight use-package-diminish use-package-bind-key bind-key easy-mmode use-package-core finder-inf edmacro kmacro compile comint ansi-color ring paren avoid delsel cus-start cus-load epg epg-config gnu-elpa-keyring-update rx info package easymenu browse-url url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel dos-w32 ls-lisp disp-table term/w32-win w32-win w32-vars term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads w32notify w32 lcms2 multi-tty make-network-process emacs) Memory information: ((conses 16 1041436 370370) (symbols 48 44596 7) (strings 32 219890 55700) (string-bytes 1 6131935) (vectors 16 115782) (vector-slots 8 2654593 430756) (floats 8 347 768) (intervals 56 50094 1190) (buffers 1000 168))