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

Re: do not write certain commands to history file



On 25 August 2010 21:26, Eric Smith <es@xxxxxxxxxxxx> wrote:
> Oh zsh seers,
>
> What is the way to match certain words in commands so that they
> are not written to the history file (but might possibly remain in the
> buffer history which does not worry me much)?
>
> (I saw a thread on history encryption, seems a bit heavy handed).

Remaining in the history buffer and writing to the history file seems
to be linked together. You can however use the zshaddhistory()
function to exclude things based on shellcode.

zshaddhistory() {
  [[ $1 != "display ~/pron/*" ]]
}

I tried using fc -p, print -s, but no way i could think of stopped
writing things to the history file while also keeping it in the local
history buffer.

-- 
Mikael Magnusson



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