syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.68k stars 4.89k forks source link

Spacemacs can't start processes in some cases #12378

Closed rpls closed 2 months ago

rpls commented 5 years ago

Description :octocat:

Emacs can't start processes in some cases. For example, when using restart-emacs, emacs will not restart but simply close. Other examples include opening attachments using notmuch (using notmuch-show-interactively-view-part, which in turn will call mm-display-external to start a process which will view the attachment, for example, a PDF viewer). No errors will show up in *Messages*. From what I can tell, the execution will (in the case of restart-emacs, and also other instances) arrive at call-process or start-process or similar, which in turn instead of starting a process, will have no effect whatsoever.

The problem is not present in a blank emacs config (i.e. emacs -q).

Layers which, for example, use language servers are completely fine by the way. So starting processes doesn't fail in general.

Reproduction guide :beetle:

Observed behaviour: :eyes: :broken_heart:

Expected behaviour: :heart: :smile:

System Info :computer:

Backtrace :paw_prints:

Not relevant

rpls commented 5 years ago

This seems to be a problem with the cached environment in .spacemacs.env. Apparently starting processes which needs a connection to X11 simply failed and restart-emacs or external file viewers started but crashed (sadly, they crashed silently) as the connection to X11 failed due to old environment variables (e.g. DISPLAY). Deleting .spacemacs.env fixed the issue for now. This didn't affect language servers and alike, as they didn't really depend on the invalid environment variables.

duianto commented 5 years ago

Both restart-emacs (SPC q r or SPC q R) and call-process works for me.

I don't know anything about X11, so I don't know if gedit connects to it. If it doesn't is there some other application I can test with?

System Info :computer:

System Info :computer:

rpls commented 5 years ago

New reproduction guide:

Mitigation for now would be to simply force the regeneration of .spacemacs.env by deleting it. Full fix would be to continually update the environment stored in .spacemacs.env.

duianto commented 5 years ago

After changing DISPLAY=:0 to: DISPLAY=:1 and restarting or pressing: SPC f e E to call dotspacemacs/call-user-env

Now (call-process "gedit") doesn't start gedit and the minibuffer shows: 1 (#o1, #x1, ?\C-a)

With DISPLAY=:0, gedit starts and when it's closed then Emacs shows: 0 (#o0, #x0, ?\C-@).

I informed the maintainers.

laynor commented 4 years ago

For me, removing the XDG_SESSION related variables, DISPLAY and xauthority from the .spacemacs.env fixed the issue.

khajavi commented 3 years ago

For me, removing the XDG_SESSION related variables, DISPLAY and xauthority from the .spacemacs.env fixed the issue.

I remove the .spacemacs.env and spacemacs created it again. now it works for me.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

github-actions[bot] commented 5 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!