[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [BUG] org-open-file immediately termininates when calling xdg-open t

From: Max Nikulin
Subject: Re: [BUG] org-open-file immediately termininates when calling xdg-open that calls emacsclient
Date: Fri, 27 May 2022 19:03:55 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1

On 27/05/2022 13:19, Ihor Radchenko wrote:

I managed to narrow down the reproducer with the following minimal

(require 'server)
(unless (server-running-p) (server-start))
(setenv "DISPLAY" ":0.0")
(define-key input-decode-map (kbd "C-[") [C-\[])

With this exact init.el, trying to run
(let ((process-connection-type nil))
   (start-process-shell-command "1" nil "xdg-open ~/.bashrc"))

Does it mean that you can not reproduce it with emacsclient instead of xdg-open? Anyway I can not reproduce it with Emacs-27.1 from Ubuntu-20.04. You may try to add before emacsclient command something like

    strace -s64 -f -t -o /tmp/emacsclient.strace

or attach strace to the running emacs using -p PID option just before executing `start-process-shell-command' and kill strace just after.

My attempt:
- Minimal LXC container, so I had to install xdg-utils and file packages
- Notice
      file --mime-type ~/.bashrc
      /home/ubuntu/.bashrc: text/plain
  so I tried with ~/.bashrc and with a script that is really recognized
  as text/x-shellscript
- ~/.local/share/applications/emacsclient-local.desktop
  from your previous message
- ~/.config/mimeapps.list
     [Added Associations]
     [Default Applications]
   without such file xdg-open can not find a handler despite I believed
   that it scans ~/.local/share/applications/ for .desktop files.
   Maybe that part of code works only for x-scheme-handler/...
   MIME types.
- emacs &
- switch from some info buffer specific to Debian
- execute the command you provided.

New frame is open and it seems reliable.

P.S. Likely it is unrelated to your problem:
emacs -Q --daemon

Warning: due to a long standing Gtk+ bug
Emacs might crash when run in daemon mode and the X11 connection is unexpectedly lost. Using an Emacs configured with --with-x-toolkit=lucid does not have this problem.
Starting Emacs daemon.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]