Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
%! prompt code shows incorrect number
- X-seq: zsh-workers 48862
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: %! prompt code shows incorrect number
- Date: Mon, 17 May 2021 06:48:35 +0200
- Archived-at: <https://zsh.org/workers/48862>
- List-id: <zsh-workers.zsh.org>
With two shells, incappendhistory and sharehistory active, this can happen:
PS1='%! '
29 echo right
right
31 echo $history[29]
echo left
Needless to say, this is surprising. Can it be fixed easily? fc -l reports:
29* echo left
30 echo right
Perhaps we could import events as numbers that are unused instead of
overriding the number we have told the user is going to be used for
the command they run?
(I am posting this without any investigation on my part as of yet, I
may look into it later...)
(If you're testing this in zsh -f, remember to: setopt rcs;
HISTSIZE=100; SAVEHIST=100; HISTFILE=/tmp/eventstest; setopt
incappendhistory sharehistory)
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author