zsh-workers
 help / color / mirror / code / Atom feed
From: schaefer@z-code.com (Barton E. Schaefer)
To: zsh-workers@math.gatech.edu (Zsh hackers list)
Subject: Re: [beta8] history saved on exec doesn't.
Date: Wed, 24 May 1995 08:42:39 -0700	[thread overview]
Message-ID: <9505240842.ZM19150@zyrcon.z-code.com> (raw)
In-Reply-To: P.Stephenson@swansea.ac.uk "Re: [beta8] history saved on exec doesn't." (May 24,  2:51pm)

On May 24,  2:51pm, P.Stephenson@swansea.ac.uk wrote:
} Subject: Re: [beta8] history saved on exec doesn't.
}
} > One other thing that is now broke 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.
}
} 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

I confess to have been pretty much ignoring zsh-list at the time this
"clever exec stuff" was being put in, so please pardon any ignorance
in the following questions, but:

I presume "clever exec stuff" really does mean "clever stuff done at
time of an `exec' zsh builtin" and *not* "clever stuff done whenever
any call in the exec(2) family is about to be made".  That is, I can't
believe zsh is now saving history every time any non-builtin command
is run.  Please tell me I'm right.

Then tell me, if I am right, why process substitution would have caused
history to be saved in the first place.  (I completely agree about never
doing anything like this in subshells in general.)

Next, explain "the SHLVL decrement" a bit; I have scripts that depend on
knowing whether they were exec'd from a login shell or from a shell
started via my .xsession, and they presently do it by examining SHLVL.
If SHLVL is suddenly going to start reverting to 1 when a level-2 shell
does an exec, my standard login routine is going to end up in an infinite
loop.  (As you can tell, I haven't installed any of these betas yet.)

Finally, please tell me there's some way to shut off all this stuff and
have an exec just be an exec.  At least some way to shut off saving of
history on exec; I don't know who thinks this is useful, but the last
N things I typically do before any interactive shell would "exec" are
either stuff from my .zlogin or commands I wouldn't want to repeat unless
I were about to do *another* exec, and as such I'd rather the history
were just left alone.  Perhaps one of:

    alias exec='SAVEHIST=0 exec'
    alias exec='HISTFILE=/dev/null exec'

(Or do we still have to use "exec HISTFILE=/dev/null"?)

-- 
Bart Schaefer                     Vice President, Technology, Z-Code Software
schaefer@z-code.com               Division of Network Computing Devices, Inc.
http://www.well.com/www/barts


  reply	other threads:[~1995-05-24 15:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-05-24 11:17 guthrie
1995-05-24 13:51 ` P.Stephenson
1995-05-24 15:42   ` Barton E. Schaefer [this message]
1995-05-24 16:55     ` P.Stephenson

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

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

  git send-email \
    --in-reply-to=9505240842.ZM19150@zyrcon.z-code.com \
    --to=schaefer@z-code.com \
    --cc=zsh-workers@math.gatech.edu \
    /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.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).