zsh-workers
 help / color / mirror / code / Atom feed
* % bug in beta20-test1
@ 1996-06-07 16:17 Geoff Wing
  1996-06-11  9:14 ` Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: Geoff Wing @ 1996-06-07 16:17 UTC (permalink / raw)
  To: zsh-list

Heyla,
  haven't checked this in beta20 but in beta20-test1,

% %
zsh: command not found: fg

I also had it not recognising "fg", and had to do "builtin fg" though I
can't reproduce that at the moment.
-- 
Mason [G.C.W]  mason@werple.mira.net.au    "Hurt...Agony...Pain...LOVE-IT"



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: % bug in beta20-test1
  1996-06-07 16:17 % bug in beta20-test1 Geoff Wing
@ 1996-06-11  9:14 ` Peter Stephenson
  1996-06-11  9:56   ` Zoltan Hidvegi
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Stephenson @ 1996-06-11  9:14 UTC (permalink / raw)
  To: Zsh hackers list

mason@werple.net.au wrote:
> % %
> zsh: command not found: fg

This is supposed to fixed this (plus the same bug which occurred with
autoresume).

> I also had it not recognising "fg", and had to do "builtin fg" though I
> can't reproduce that at the moment.

It's assumed not to fix this.

*** Src/exec.c.fg	Tue Jun 11 11:01:27 1996
--- Src/exec.c	Tue Jun 11 11:01:27 1996
***************
*** 1191,1196 ****
--- 1191,1220 ----
  		    }
  		    return;
  		}
+ 	    } else {
+ 		/* If AUTORESUME is set, the command is SIMPLE, and     *
+ 		 * doesn't have any redirections, then check if it      *
+ 		 * matches as a prefix of a job currently in the job    *
+ 		 * table.  If it does, then we treat it as a command to *
+ 		 * resume this job.                                     */
+ 		if (isset(AUTORESUME) && (how & Z_SYNC) && empty(cmd->redir) &&
+ 		    !input && !nextnode(firstnode(args)) && !cmd->flags) {
+ 		    if (unset(NOTIFY))
+ 			scanjobs();
+ 		    if (findjobnam(peekfirst(args)) != -1) {
+ 			pushnode(args, dupstring("fg"));
+ 			checked = 0;
+ 		    }
+ 		}
+ 		/* If the command begins with `%', then assume it is a *
+ 		 * reference to a job in the job table.                */
+ 		if (*(char *)peekfirst(args) == '%') {
+ 		    pushnode(args, dupstring((how & Z_DISOWN)
+ 					     ? "disown" : (how & Z_ASYNC)
+ 					     ? "bg" : "fg"));
+ 		    how = Z_SYNC;
+ 		    checked = 0;
+ 		}
  	    }
  
  	    if (errflag || checked || (cflags & BINF_COMMAND))
***************
*** 1214,1240 ****
  	    hn = NULL;
  	}
      }
- 
-     /* If the command begins with `%', then assume it is a *
-      * reference to a job in the job table.                */
-     if (nonempty(args) && *(char *)peekfirst(args) == '%') {
- 	pushnode(args, dupstring((how & Z_DISOWN)
- 				 ? "disown" : (how & Z_ASYNC) ? "bg" : "fg"));
- 	how = Z_SYNC;
-     }
- 
-     /* If AUTORESUME is set, the command is SIMPLE, and doesn't have *
-      * any redirections, then check if it matches as a prefix of a   *
-      * job currently in the job table.  If it does, then we treat it *
-      * as a command to resume this job.                              */
-     if (isset(AUTORESUME) && type == SIMPLE && (how & Z_SYNC) &&
- 	nonempty(args) && empty(cmd->redir) && !input &&
- 	!nextnode(firstnode(args)) && !cmd->flags) {
- 	if (unset(NOTIFY))
- 	    scanjobs();
- 	if (findjobnam(peekfirst(args)) != -1)
- 	    pushnode(args, dupstring("fg"));
-     }
  
      /* Get the text associated with this command. */
      if (jobbing || (how & Z_TIMED))
--- 1238,1243 ----

-- 
Peter Stephenson <pws@ifh.de>       Tel: +49 33762 77366
WWW:  http://www.ifh.de/~pws/       Fax: +49 33762 77330
Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, 15735 Zeuthen, Germany.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: % bug in beta20-test1
  1996-06-11  9:14 ` Peter Stephenson
@ 1996-06-11  9:56   ` Zoltan Hidvegi
  1996-06-11 11:24     ` Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: Zoltan Hidvegi @ 1996-06-11  9:56 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: zsh-workers

[-- Attachment #1: Type: application/pgp, Size: 5527 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: % bug in beta20-test1
  1996-06-11  9:56   ` Zoltan Hidvegi
@ 1996-06-11 11:24     ` Peter Stephenson
  1996-06-11 11:45       ` Zoltan Hidvegi
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Stephenson @ 1996-06-11 11:24 UTC (permalink / raw)
  To: Zsh hackers list

hzoli@cs.elte.hu wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> 
> > mason@werple.net.au wrote:
> > > % %
> > > zsh: command not found: fg
> > 
> > This is supposed to fixed this (plus the same bug which occurred with
> > autoresume).
> 
> I did not try this patch but it seems that things like command %1 or
> foo=%1 ; $foo will trigger autoresume.

The second of these was entirely deliberate.  I still think that's
preferable.  You can handle the first by looking at the command flags
when checking. 

-- 
Peter Stephenson <pws@ifh.de>       Tel: +49 33762 77366
WWW:  http://www.ifh.de/~pws/       Fax: +49 33762 77330
Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, 15735 Zeuthen, Germany.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: % bug in beta20-test1
  1996-06-11 11:24     ` Peter Stephenson
@ 1996-06-11 11:45       ` Zoltan Hidvegi
  0 siblings, 0 replies; 5+ messages in thread
From: Zoltan Hidvegi @ 1996-06-11 11:45 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: zsh-workers

> hzoli@cs.elte.hu wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > 
> > > mason@werple.net.au wrote:
> > > > % %
> > > > zsh: command not found: fg
> > > 
> > > This is supposed to fixed this (plus the same bug which occurred with
> > > autoresume).
> > 
> > I did not try this patch but it seems that things like command %1 or
> > foo=%1 ; $foo will trigger autoresume.
> 
> The second of these was entirely deliberate.  I still think that's
> preferable.

I do not see why.  You can always use fg $foo explicitely.

>  You can handle the first by looking at the command flags
> when checking. 

I know that (but cflags should be used instead of cmd->flags).  But there
is an other problem.  With your patch \%1 also triggers autoresume so it is
not possible to execute a command beginning with a % (but correct me if I'm
wrong, I did not try your patch).

foo=%1 ; $foo never worked and noone complaind about it.

Zoltan



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1996-06-11 11:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-06-07 16:17 % bug in beta20-test1 Geoff Wing
1996-06-11  9:14 ` Peter Stephenson
1996-06-11  9:56   ` Zoltan Hidvegi
1996-06-11 11:24     ` Peter Stephenson
1996-06-11 11:45       ` Zoltan Hidvegi

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).