From: jeberger@free.fr
To: 61748@debbugs.gnu.org
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) [thread overview]
Message-ID: <774021794.15662399.1677224385920.JavaMail.root@zimbra60-e10.priv.proxad.net> (raw)
In-Reply-To: <1909672588.15608265.1677223717877.JavaMail.root@zimbra60-e10.priv.proxad.net>
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")`)
- <key>M-x</key> `eglot`.
# Expected result:
Eglot should start
# Actual result:
Eglot asks `Enter program to execute (or <host>:<port>):`, 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.:
```lisp
(defun eglot--cmd (contact)
"Helper for `eglot--connect'."
(if (file-remote-p default-directory)
;; TODO: this seems like a bug, although it’s 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’t 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\x01!\205!\0r\211q\210\b\203\x1d\0 \203\x1d\0\304\305\306\307 $\210\310\311!\210\312\211\x12)\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’t 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=x86_64-w64-mingw32
--without-compress-install 'CFLAGS=-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/chocolatey/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/Emacs/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/tools/emacs/share/emacs/27.2/lisp/play/mpuz
d:/home/.emacs.d/elpa/seq-2.23/seq hides c:/ProgramData/chocolatey/lib/Emacs/tools/emacs/share/emacs/27.2/lisp/emacs-lisp/seq
d:/home/.emacs.d/elpa/eldoc-1.13.0/eldoc hides c:/ProgramData/chocolatey/lib/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))
next parent reply other threads:[~2023-02-24 7:39 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1909672588.15608265.1677223717877.JavaMail.root@zimbra60-e10.priv.proxad.net>
2023-02-24 7:39 ` jeberger [this message]
2023-02-24 8:15 ` bug#61748: 27.2; Eglot should use shell-file-name when launching the language server for a remote file Eli Zaretskii
2023-02-24 11:11 ` jeberger
2023-02-24 16:44 ` Michael Albinus
2023-02-27 11:07 ` João Távora
2023-02-27 12:05 ` João Távora
2023-02-27 17:59 ` bug#61748: [informatique] " Jérôme M. Berger
2023-02-27 23:41 ` João Távora
2023-02-28 9:50 ` jeberger
2023-02-28 10:14 ` Michael Albinus
2023-02-28 10:28 ` João Távora
2023-02-27 19:57 ` Michael Albinus
2023-02-27 20:07 ` João Távora
2023-02-27 20:13 ` Michael Albinus
2023-02-28 0:00 ` João Távora
2023-02-28 8:41 ` Michael Albinus
2023-02-28 12:18 ` João Távora
2023-02-28 12:34 ` Michael Albinus
2023-02-28 12:46 ` João Távora
2023-02-28 13:05 ` Michael Albinus
2023-02-28 13:47 ` João Távora
2023-02-28 14:10 ` Michael Albinus
2023-02-28 14:24 ` João Távora
2023-02-28 14:45 ` Michael Albinus
2023-02-28 15:13 ` João Távora
2023-02-28 15:44 ` Michael Albinus
2023-02-28 16:43 ` Eli Zaretskii
2023-02-28 16:49 ` João Távora
2023-02-28 17:56 ` Eli Zaretskii
2023-03-01 4:34 ` Richard Stallman
2023-03-01 9:31 ` João Távora
2023-03-01 13:04 ` Eli Zaretskii
2023-03-01 13:05 ` João Távora
2023-02-28 13:59 ` jeberger
2023-02-28 14:25 ` João Távora
2023-02-28 14:49 ` Michael Albinus
2023-02-28 14:53 ` João Távora
2023-02-28 15:15 ` Michael Albinus
2023-02-28 15:23 ` João Távora
2023-02-28 15:50 ` Michael Albinus
2023-02-28 16:28 ` João Távora
2023-03-02 9:14 ` Michael Albinus
2023-03-02 10:56 ` João Távora
2023-03-02 11:40 ` Michael Albinus
2023-03-03 0:24 ` João Távora
2023-02-28 14:49 ` jeberger
2023-02-28 15:07 ` João Távora
2023-02-28 15:12 ` Michael Albinus
2023-02-28 16:16 ` jeberger
2023-02-28 16:41 ` jeberger
2023-02-28 17:09 ` João Távora
2023-03-01 8:09 ` jeberger
2023-03-02 13:28 ` João Távora
2023-03-07 10:15 ` João Távora
2023-03-01 8:39 ` Michael Albinus
2023-03-01 8:51 ` jeberger
2023-03-01 9:07 ` Michael Albinus
2023-03-01 10:01 ` jeberger
2023-03-01 10:11 ` Michael Albinus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=774021794.15662399.1677224385920.JavaMail.root@zimbra60-e10.priv.proxad.net \
--to=jeberger@free.fr \
--cc=61748@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).