Subject: FVWM: [2.0.42] new Exec functionality

From: "Paul D. Smith" <[email-masked]>
Date: Thu, 18 Apr 96 17:15:46 EDT

I'd like to talk about the new Exec feature Chuck added where the "exec"
and "&" aren't necessary any more.

I know one person posted saying a command he used to use didn't work any
more under the new style, and Chuck said he was going to remove the
feature.

I'd like to discuss this further, first: I _LIKE_ the enhancement, and I
really hope we keep it.

I like that I don't have to worry about adding "exec".  And for newer
users who don't really know what's going on, it's a big win in
ease-of-use and readability.

Instead of removing the feature, can't we add a bit of smarts to it to
get it working correctly so that in the vast majority of the cases, when
you just want to start some app, you can just say "Exec foo", and yet
still get what you want for more advanced situations?  I think the
problem was something like this:

  "foo" Exec cd /home/foo; foo

was translated to this:

  exec cd /home/foo; foo

since the cd was exec'd, foo was never run.

One idea would be for fvwm2 to look through the string to be exec'd and,
if it sees something that means multiple apps are running, doesn't add
the exec.  GNU make, for example, does something similar.

I think a sufficient rule is if fvwm sees any unquoted instance of ";"
or "|" in the command string, it should not add exec.  For Bourne shell,
anyway, that should definitely do it.  I wouldn't get pathological about
testing for quoting, either; what's an extra shell or two now and then
for obscure cases?

Another alternative is to keep the default behavior as is, but add a way
to turn it off for advanced cases... a workaround that is gross but that
works right now is this:

  "foo" Exec /bin/sh -c 'cd /home/foo; foo'

which would expand to:

  exec /bin/sh -c 'cd /home/foo; foo'

Certainly that's not optimal, but it works and this is not a normal case
so maybe it's acceptable.  Maybe someone has a better idea.

Bottom line, I think the enhancement is very useful for the vast
majority of cases, and we should try to resolve the problem raised above
somehow without punting the enhancement.

My $0.02.

-------------------------------------------------------------------------------
 Paul D. Smith <[email-masked]>         Network Management Development
 Senior Software Engineer                                   Bay Networks, Inc.
-----------------------------------------------==<http://www.baynetworks.com/>-
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
     These are my opinions--Bay Networks takes no responsibility for them.
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Dan Espen <[email-masked]>
Date: Fri, 19 Apr 1996 08:59:50 -0400

----------
> I'd like to discuss this further, first: I _LIKE_ the enhancement, and I
...
>   exec /bin/sh -c 'cd /home/foo; foo'

I was  the   one  that complained  about   the  loss of  functionality
originally.  The solution you show above is sufficient for me.  I also
considered Brady  Montz's proposal  for a "Run"   command with the old
behavior, which would  be a little  cleaner, but given fvwm2's  design
goal of compactness,  I would  have  to favor a little  strangeness in
using Exec, as opposed to adding another command to fvwm2.

Enclosed are the diffs to enhance the fvwm2 man page to explain how to
do this.  (Note that I also  enclosed a change  in the same section on
the placement  of the string '&'.)  Before  I moved the '&', man would
just cut off  the  rest of the  sentence.   (Using "esc x  man"  under
XEmacs.)

*** fvwm2.man.orig	Fri Apr 19 08:37:54 1996
--- fvwm2.man	Fri Apr 19 08:44:59 1996
***************
*** 620,627 ****

  .IP "Exec \fIcommand\fP"
! Executes \fIcommand\fP.  Exec doesn't require an additional 'exec' or
! '&' in the command.
  
  The following example binds function key F1 in the root window, with
  no modifiers, to the exec function.  The program rxvt will be started
--- 620,627 ----

  .IP "Exec \fIcommand\fP"
! Executes \fIcommand\fP.  Exec doesn't require an additional 'exec' or '&'
! in the command.
  
  The following example binds function key F1 in the root window, with
  no modifiers, to the exec function.  The program rxvt will be started
***************
*** 630,635 ****
--- 630,640 ----
  Key F1 R N Exec rxvt -fg yellow -bg blue -e /bin/tcsh
  .EE
  
+ To execute a series of commands, run  the commands within a shell like
+ this:
+ .EX
+ Key F1 R N Exec /bin/sh -c 'cd $HOME/audio;nice audiotool'
+ .EE
  
  .IP "ExecUseShell \fI[shell]\fP"
  Makes the Exec command use the specified shell, or the value of the

> -----------------------------------------------==<http://www.baynetworks.com/
> >-

--
Dan Espen                                    Phone: (908) 699-5570
[email-masked]
444 Hoes Lane  Room RRC 1C-214
Piscataway, NJ 08854
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].