Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: fc (history) requires zsh is interactive? Why can't interactive toggled?
- X-seq: zsh-workers 25709
- From: "Rocky Bernstein" <rocky.bernstein@xxxxxxxxx>
- To: "Peter Stephenson" <pws@xxxxxxx>
- Subject: Re: fc (history) requires zsh is interactive? Why can't interactive toggled?
- Date: Mon, 22 Sep 2008 09:58:51 -0400
- Cc: "Zsh hackers list" <zsh-workers@xxxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=6mRwcwSLFHFZF/5sNbT046yJS7jGRqe/qBH4B/AOJIc=; b=oRD4+c5bIkmyKHZvJnNdquRIoJTjjYY45IDhNIkl7Y7U017b1uSdqBfpwCQrdvUElg MixNBEh1i4ywLiepByDvKysTbn2fCT0+3CQ6sF3mLFz/Y0MgOsUVvxUE1zdZsvWrbeqd 9/cYFZ4+TY1CkcstYAmpmdYUQ9ePe8kBBJYhc=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=mCUuSePMl4WNGMxrQiDs5IHuw6TmyUsJS9brIksunZvrMlWDWlzLpn9bwLat4x9KP9 xtUcukV5u1C7rX2Z5poK0HqXq+8PBfPOT7oZ6022TrEEiDDOwWi1JYEy/ZazMHI8XjTi 70OIMFTKBqSVMOw8mmivPkyor3rvFjzUxNc7o=
- In-reply-to: <20080922130602.4746e4d1@news01>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <6cd6de210809211737o564e47a4jf7f92ada4cd970dc@xxxxxxxxxxxxxx> <20080922130602.4746e4d1@news01>
On Mon, Sep 22, 2008 at 8:06 AM, Peter Stephenson <pws@xxxxxxx> wrote:
>
> On Sun, 21 Sep 2008 20:37:13 -0400
> "Rocky Bernstein" <rocky.bernstein@xxxxxxxxx> wrote:
> > When I run fc -l (history) from a zsh script that isn't interactive I get
> > the message
> > not interactive shell
> >
> > Why is it that fc -l needs an interactive shell? One can put entries in the
> > history and one can use vared to cycle through them, so what is it about an
> > interactive shell that is important here?
>
> When non-interactive, history isn't loaded at the start and needs loading
> for the command you're running or by special interaction.
Right, but a command processors has to know to do that dance. It's in
Functions/Misc/zcalc, and in sticky-note which were suggested as
examples of command processors.
> So "fc -l"
> hasn't been very useful and the error message tends to be more helpful than
> simply doing nothing because you're in a non-interactive shell with, the
> vast majority of the time, no history.
The problem is that an error message which prevents functioning of a
command should only be given when there *is* an error, not in
anticipation of a situation which sometimes is an error. ;-) If there
is history in the history list, then fc -l should show it, and if
there is no history it could either report no history and/or suggest
that not being in an interactive mode might be one (but not the only)
reason why.
> There's no basic reason why it
> shouldn't work if history works elsewhere.
Could this be changed please?
>
> > Related to this, why can't an interactive shell be toggled?
>
> No basic reason, again, but it's a complicated support nightmare making
> things changeable at run time rather than, as now, once when the shell
> starts up. For example, turning on job control in the middle of a
> hitherto non-interactive shell changes the nature of what's stored in the
> job table. All that could in principle be fixed, it's just work, and
> likely to be fairly low priority since we have very little effort
> available for new large-scale tasks, particularly those which are
> liable to introduce bugs.
Ok. I think this needs to be done one step at a time. If one can issue
instructions to turn on various pieces that were disabled by virtue of
being non-interactive (like setting/reading history files), then
changing all of this in one shot isn't all that important.
>
> --
> Peter Stephenson <pws@xxxxxxx> Software Engineer
> CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
> Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
Messages sorted by:
Reverse Date,
Date,
Thread,
Author