Skip to content

compatibility issues with lsp-tramp-connection and emacs 28 #2514

Closed
@tshu-w

Description

@tshu-w

Describe the bug
In emacs GNU Emacs 28.0.50, start-file-process-shell-command was update from:

(defun start-file-process-shell-command (name buffer &rest args)
  "Start a program in a subprocess.  Return the process object for it.
Similar to `start-process-shell-command', but calls `start-file-process'."
  (declare (advertised-calling-convention (name buffer command) "23.1"))
  ;; On remote hosts, the local `shell-file-name' might be useless.
  (with-connection-local-variables
   (start-file-process
    name buffer
    shell-file-name shell-command-switch
    (mapconcat 'identity args " "))))

to:

(defun start-file-process-shell-command (name buffer command)
  "Start a program in a subprocess.  Return the process object for it.
Similar to `start-process-shell-command', but calls `start-file-process'."
  ;; On remote hosts, the local `shell-file-name' might be useless.
  (with-connection-local-variables
   (start-file-process
    name buffer shell-file-name shell-command-switch command)))

which make lsp-tramp-connection unusable.

A temporary solution on user side:

    (defun start-file-process-shell-command@around (start-file-process-shell-command name buffer &rest args)
      "Start a program in a subprocess.  Return the process object for it.
Similar to `start-process-shell-command', but calls `start-file-process'."
      ;; On remote hosts, the local `shell-file-name' might be useless.
      (let ((command (mapconcat 'identity args " ")))
        (funcall start-file-process-shell-command name buffer command)))

    (advice-add 'start-file-process-shell-command :around #'start-file-process-shell-command@around)

By the way, tramp complain about when lsp make tramp connection:

Error processing message (remote-file-error "Forbidden reentrant call of Tramp").
Remote file error: Forbidden reentrant call of Tramp

TRAMP user manual explains that

Timers, process filters and sentinels, and other event based functions can run at any time, when a remote file operation is still running. This can cause TRAMP to block. When such a situation is detected, this error is triggered. It shall be fixed in the respective function (an error report will help).

Is this the reason why lsp tramp often blocks emacs? #1845. Is there any way to improve lsp-tramp-connection?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions