lsp-mode
lsp-mode copied to clipboard
lsp-mode using shell-file-name for TRAMP connections
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
- Launch emacs from fish shell
- Browse remote host via TRAMP
- Open C source file on remote host
- Configure project root when prompted
- Receive notification that clangd process has failed to start
- 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
Affected by same issue. The PR fixes it for me