Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [beta8] history saved on exec doesn't.



guthrie@xxxxxxxxxxxxxx wrote:
> Mark Borges <mdb@xxxxxxxxxxxx> wrote:
> One other thing that is now borke is if I do any command substitution in
> the startup scripts (to set a variable say) after I have set the SAVEHIST
> and HISTFILE variables, and I don't have APPEND_HISTORY set, then this wipes
> out the history file as well.  (But I guess that this should make sense if
> exec is wiping out the history file under these same conditions.)

Actually, this is a good point and I don't think any of the clever
exec stuff should ever be done in a subshell (if forked is set in
execcmd()).  This includes the SHLVL decrement since if you're
exec'ing a command in subshell you should presumably still `see' the
level of the parent shell.  Feel free to find some weird exceptions.

*** Src/exec.c~	Tue May 23 15:36:01 1995
--- Src/exec.c	Wed May 24 14:42:44 1995
***************
*** 1448,1454 ****
  	    }
  
  	} else {
! 	    if (cmd->flags & CFLAG_EXEC) {
  		setiparam("SHLVL", --shlvl);
  		if (unset(NORCS) && interact)
  		    /* save the history file through execs */
--- 1448,1454 ----
  	    }
  
  	} else {
! 	    if ((cmd->flags & CFLAG_EXEC) && !forked) {
  		setiparam("SHLVL", --shlvl);
  		if (unset(NORCS) && interact)
  		    /* save the history file through execs */

-- 
Peter Stephenson <P.Stephenson@xxxxxxxxxxxxx>  Tel: +44 1792 205678 extn. 4461
WWW:  http://python.swan.ac.uk/~pypeters/      Fax: +44 1792 295324
Department of Physics, University of Wales, Swansea,
Singleton Park, Swansea, SA2 8PP, U.K.



Messages sorted by: Reverse Date, Date, Thread, Author