unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Jan Djärv" <jan.h.d@swipnet.se>
To: Juri Linkov <juri@jurta.org>
Cc: ferkiwi+a@gmail.com, emacs-devel@gnu.org
Subject: Re: & and M-& to run programs asynchronously
Date: Tue, 07 Jul 2009 12:02:43 +0200	[thread overview]
Message-ID: <4A531D43.4010105@swipnet.se> (raw)
In-Reply-To: <873a9a266b.fsf@mail.jurta.org>

Juri Linkov skrev:
>> I don't know if it's worth to open a new thread, but as this one is
>> related I'll like to report some problem I've had while testing the
>> new "&" command  (dired-do-async-shell-command).
>>
>> If you use it to execute a command that opens a child process then it
>> will have no effect at all, the parent process will be finished and no
>> program will be executed. You can reproduce this if you execute &
>> xdg-open (freedesktop command for opening a file).
>>
>> dired-do-shell-command does work when you use it to execute xdg-open,
>> but it will run the program synchronously.
>>
>> Would it be possible to fix this so that "&" waits for child processes
>> running asynchronously to finish?
> 
> I see that running `M-! xdg-open file &' works correctly on KDE,
> but fails on Gnome.  Is this an Emacs bug at all?
> 

On my system emacs starts a shell in a subprocess that execs xdg-open.
xdg-open starts gnome-open in a subprocess and waits for it to finish.  I 
presume KDE starts kde-open instead. gnome-open then starts the real program 
without waiting for it to finish.

I can see that gnome-open does not close the tty before execing the real 
program, so when the tty goes away (i.e. gnome-open finishes) a SIGHUP is 
sent.  That means the program dies.

kde-open on the other hand does close the controlling tty.

One way to fix this in Emacs would be to keep the tty around as long as there 
are processes that has it open (like ssh does).  But IMHO this is a bug in 
gnome-open.

	Jan D.




  reply	other threads:[~2009-07-07 10:02 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-23  8:13 Short explanation for & in key ! of dired Daniel Clemente
2008-06-23  9:24 ` David Kastrup
2008-06-23  9:31   ` Miles Bader
2008-06-24 23:05     ` Juri Linkov
2008-06-25  6:51       ` joakim
2008-06-25  6:59         ` Miles Bader
2008-06-25  7:10           ` David Kastrup
2008-06-25  7:15             ` David Kastrup
2008-06-25  8:19             ` joakim
2008-06-25  8:30               ` Miles Bader
2008-06-25  8:44                 ` joakim
2008-06-25 16:14                   ` Paul R
2008-06-26 12:04                   ` Lynbech Christian
2008-06-26 12:10                     ` David Kastrup
2008-06-26 22:46                       ` Phil Jackson
2008-06-27 23:30                       ` Juri Linkov
2008-06-28  1:04                         ` Miles Bader
2008-06-28 19:47                           ` Juri Linkov
2008-06-25 18:03               ` Mathias Dahl
2008-06-25 18:52                 ` Stefan Monnier
2008-07-03 11:34       ` & and M-& to run programs asynchronously (was: Re: Short explanation for & in key ! of dired) Daniel Clemente
2008-07-03 11:45         ` & and M-& to run programs asynchronously David Kastrup
2008-07-06 18:54           ` Juri Linkov
2008-07-06 19:41             ` David Kastrup
2008-07-07 22:12               ` Juri Linkov
2008-07-08  0:37                 ` Miles Bader
2008-07-08 23:07                   ` Juri Linkov
2008-07-09  5:30                     ` Edward O'Connor
2008-07-09 20:35                       ` Juri Linkov
2008-07-09 20:39                         ` Edward O'Connor
2008-07-06 18:57         ` Juri Linkov
2008-07-16 18:46         ` Daniel Clemente
2008-07-17  0:33           ` Juri Linkov
2008-07-18  9:20             ` Daniel Clemente
2008-07-19  0:27               ` Juri Linkov
2008-07-22 19:50                 ` Mathias Dahl
2008-07-22 22:48                   ` Juri Linkov
2008-07-29 14:53                     ` Daniel Clemente
2008-07-29 16:51                       ` Juri Linkov
2008-07-31 14:07                         ` Chong Yidong
2008-07-31 15:30                           ` Juri Linkov
2008-08-18  0:24                             ` Daniel Clemente
2008-08-25 19:52                               ` Juri Linkov
2008-08-28 17:33                                 ` Daniel Clemente
2008-08-29  5:59                                 ` tomas
2008-09-10 23:57                                   ` Juri Linkov
2009-10-14  0:47                           ` Daniel Clemente
2008-09-06 17:10         ` Daniel Clemente
2008-09-10 23:52           ` Juri Linkov
2008-11-15 13:13             ` Daniel Clemente
2008-11-15 16:12               ` Chong Yidong
2009-06-28  9:51             ` Daniel Clemente
2009-06-28 21:52               ` Juri Linkov
2009-06-29 16:52                 ` Daniel Clemente
2009-06-30  0:02                   ` Juri Linkov
     [not found]                     ` <jwvljn91ns5.fsf-monnier+emacs@gnu.org>
2009-06-30 20:19                       ` Lennart Borgman
2009-07-01  0:02                       ` Juri Linkov
2009-07-01  1:03                         ` Miles Bader
2009-07-02 23:27                           ` Juri Linkov
2009-07-05 19:42                             ` Fernando
2009-07-06 23:51                               ` Juri Linkov
2009-07-07 10:02                                 ` Jan Djärv [this message]
2009-07-01 15:03                         ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A531D43.4010105@swipnet.se \
    --to=jan.h.d@swipnet.se \
    --cc=emacs-devel@gnu.org \
    --cc=ferkiwi+a@gmail.com \
    --cc=juri@jurta.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).