browse-url in Emacs can be used to start a browser process to visit a given URL. It is used by many packages such as
mu4e, etc. However, on GNU/Linux, by default a new browser process started by
browse-url will be killed if the Emacs process exits. To prevent the browser process from being killed, add the following code to your Emacs init file:
(when (and (executable-find "setsid") (executable-find "gnome-open")) (setq browse-url-browser-function (lambda (url &optional ignored) (start-process "" nil "setsid" "gnome-open" url))))
You will need both the
gnome-open commands available. Note that replacing
xdg-open is not guaranteed to work.