Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: History
- X-seq: zsh-users 5346
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
- To: GoTaR <gotar@xxxxxxxxxxxxxx>
- Subject: Re: History
- Date: Sat, 14 Sep 2002 21:22:40 +0000
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <20020911114230.GA345@os>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20020910173015.GA25731@os> <15742.18195.265640.747347@xxxxxxxxxxxxxxxxxxxxxxx> <20020911053928.GA234@os> <1020911092846.ZM2431@xxxxxxxxxxxxxxxxxxxxxxx> <20020911114230.GA345@os>
On Sep 11, 1:42pm, GoTaR wrote:
}
} So removing from history is possible only by leading space, not by
} configurable pattern, is it right? :/
That is correct. There was some discussion several months ago of having
a pattern match for history exclusion, but it didn't lead to anything.
It is, however, possible to selectively insert into the history commands
that would otherwise be ignored. Try something like this:
setopt hist_ignore_space
alias cd=' builtin cd'
function preexec {
if [[ "$1" = 'cd '* && "$1" != 'cd "`echo '*'`"' ]]
then
print -s "$1" # explicitly add it to the history
# else it already will be in the history, so do nothing
fi
}
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
Messages sorted by:
Reverse Date,
Date,
Thread,
Author