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

Re: Finer control over what gets written to the history file



On Oct 15,  5:58pm, Peter Stephenson wrote:
} Subject: Re: Finer control over what gets written to the history file
}
} On Tue, 15 Oct 2013 09:41:00 -0700
} Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
} > It'd be nice to be able to selectively exclude those from history after
} > the fact, also without having to remember to type a leading space on
} > every such line.
} 
} You know about the zshaddhistory hook?  Excluding by pattern is a
} fairly easy instance of this, and it should be readily extensible for
} various different ways of checking.

Yes, but it happens at the wrong time.  I don't want to prevent stuff
from going into the history as I type it, I want to filter it out of
the runtime history just before saving it.

I.e., I want to realize 30 commands later that I really don't need the
last 30 iterations of "Src/zsh -ec '{ /bin/cp } 2>>(sleep 1; cat -n)'"
to be written to the history file.  By that time zshaddhistory is long
out of the picture.

I suppose I could have gone with a zshsavehistory hook instead, but it
seemed a lot more straightforward to copy the CORRECT_IGNORE code.  :-)



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