Re: Any way to run apps detached from e2?

  • From: tpgww@xxxxxxxxxxx
  • To: emelfm2@xxxxxxxxxxxxx
  • Date: Thu, 13 Jul 2006 12:34:33 -0400

> > > I've tried a lot of things and can't seem to find a way to execute
> > > apps in such a way that they detach from e2. I wrote a simple
> > > little script: e2_exec which contains:
> > > 
> > > =====================
> > > #!/bin/sh
> > > 
> > > eval exec "$@"&
> > > 
> > > =====================
> > > 
> > > This works for $[command-xterm]. That is, if I set:
> > > 
> > > command-xterm=e2_exec rxvt
> > > 
> > > then, when I launch $[command-xterm], e2 does not see rxvt as a
> > > "child" and will quit without complaining of child processes still
> > > running.
> > I presume that the child process which ran the script ends quickly.
> > Considering the comments below, the quick finish seems to be a
> > consequence of what the script argument is (and possibly because that
> > app. is a terminal).
> 
> Sounds reasonable, but there must be something in the way that the
> command is executed by e2, as well. I just tried it with the gimp, and
> find that if I set command-xterm to "e2_exec gimp" and add a context
> menu entry:
> 
> Test||false|false|$[command-xterm]|%f&
> 
> Then gimp will not be seen as a child, and I can quit e2 normally
> without the confirmation dialog. Of course, everything has its problems.
> If I try it with command-xterm set to "e2_exec mplayer" and play a video
> file that way, e2 quits without complaining, but mplayer dies too!
> 
> I find that I can also add a normal "context menu" item:
> 
> Test||false|false|e2_exec gimp|%f&
> 
> And gimp will run "detached," as will mplayer (with the same problem
> though... dies when I quit e2).
> 
> It's only when I try to add such a command to a "filetype" that I just
> can't get it to work. 
> 
> Oh well... one for the wishlist if I may. I wish that e2 had something
> like the bash "exec" feature that allowed background programs to run in
> a subshell, detached from the "terminal."

Aside from interpretation, all the commands:
 xterm
 $[command-xterm]
 e2_exec rxvt
 e2_exec opera %f
 e2_exec gimp
 e2_exec gimp %f
are executed by the same sequence of functions. I can't think of any reason why 
a filetype-assignment would have any impact on the way that occurs. Hence my 
recent speculation about the nature (i.e. behaviour) of the app that is 
supplied as the script argument.

A new shell is used when a command is prefixed by ">" - you mentioned that 
didn't help ...

An emelfm2 session is normally detached from the controlling terminal (but not 
if debug support is enabled). What happens if you run 'emelfm2 -n' to prevent 
terminal detachment ?

Regards
Tom


-- 
Users can unsubscribe from the list by sending email to 
emelfm2-request@xxxxxxxxxxxxx with 'unsubscribe' in the subject field or by 
logging into the web interface.

Other related posts: