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

Re: Proposed feature: Selectively avoid adding to history (with code)

On Tue, Feb 23, 2010 at 03:47, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:

> It'd be more useful if I could retroactively delete the last several
> commands from my history, because I never remember to turn this sort
> of thing on before I start testing. :-)

There is something on the mailing list about that. I used to use it, but
don't need to any more, as I have become better at opening new
shells for testing & doing HISTFILE=''.

> I'm not sure what you mean by "should be a _function"?

A built-in function that can be overriden.

> HIST_DISABLE or would probably be a better name.  Won't one of the side-
> effects be that you can't find those commands in the interactive history
> either?

I wanted to express that the effect is temporary and normal operation can
be resumed with the press of a button, so to speak. Also, that everything
before or after will still be stored.

>  I'd like stuff to remain in the interactive history but somehow
> be tagged so they're never written to $HISTFILE, which brings me to ...

Sounds useful but potentially confusing.

> A tagging effect probably does need to be controlled by an option, as
> the alternative is a builtin you can only call from zshaddhistory() or
> some such; but I think for what you've got here, your approach is fine.

If the topic of tagging comes up, there is other stuff that could be put
into the enhanced history. For example, PWD comes to mind.


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