lsp-mode icon indicating copy to clipboard operation
lsp-mode copied to clipboard

lsp-mode using shell-file-name for TRAMP connections

Open cj-obrien opened this issue 11 months ago • 1 comments

Thank you for the bug report

  • [X] I am using the latest version of lsp-mode related packages.
  • [X] I checked FAQ and Troubleshooting sections
  • [X] You may also try reproduce the issue using clean environment using the following command: M-x lsp-start-plain

Bug description

lsp-mode.el uses shell-file-name to launch the language server (clangd, in my case) even when connected to a remote host via TRAMP. I use fish on my local host, but it is not installed on a remote machine I use for development; this prevents me from using lsp-mode unless I first customize shell-file-name.

Surely the TRAMP remote-shell property would be a more appropriate choice?

https://www.gnu.org/software/tramp/#Predefined-connection-information

Steps to reproduce

  1. Launch emacs from fish shell
  2. Browse remote host via TRAMP
  3. Open C source file on remote host
  4. Configure project root when prompted
  5. Receive notification that clangd process has failed to start
  6. Check clangd-tramp::stderr buffer and observe that clangd did not start because /usr/bin/fish was not found.

Expected behavior

The shell specified by the TRAMP remote-shell property for this host is used in place of fish

Which Language Server did you use?

lsp-clangd

OS

Linux

Error callstack

No response

Anything else?

No response

cj-obrien avatar Mar 15 '24 20:03 cj-obrien

Affected by same issue. The PR fixes it for me

sprig avatar Aug 24 '24 07:08 sprig