Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Finer control over what gets written to the history file
Incidentally ...
On Oct 15, 5:58pm, Peter Stephenson quoted the docs:
>
> zshaddhistory
> The following example function first adds the history line to
> the normal history with the newline stripped, which is usually
> the correct behaviour. Then it switches the history context so
> that the line will be written to a history file in the current
> directory.
>
> zshaddhistory() {
> print -sr -- ${1%%$'\n'}
> fc -p .zsh_local_history
> }
This doesn't quite work, does it? The missing bit being that you also
must have INC_APPEND_HISTORY set, otherwise the stack is popped before
anything is written.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author