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

prexec never gets empty string?



Am I misunderstanding the docs, or is this a bug?

> If the history mechanism is active (and the line was not discarded from
the history buffer), the string that the user typed is passed as the first
argument, otherwise it is an empty string.

Yet, whether I "discard" (as I understand it) a command because of
histnostore, histignorespace, histnodups, or by returning non-zero from
zshaddhistory(), I never get an empty string as the first argument in
preexec().

That is:

    % setopt histignorespace
    % preexec() { echo $1 }
    %   true ignore me
     true ignore me

zsh 5.0.2 (x86_64-pc-linux-gnu)
Ubuntu 14.04.1

By the way, for me this is related to a question I had opened
<http://superuser.com/questions/877206/zsh-prompts-history-number-sometimes-increments-after-ignored-commands>
on Stack Overflow, trying to get the prompt expansion `%!` to truly be "the
number that is to be assigned to the next command".

Thanks in advance.


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