zsh-workers
 help / color / mirror / code / Atom feed
* %! prompt code shows incorrect number
@ 2021-05-17  4:48 Mikael Magnusson
  2021-05-17  5:05 ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Mikael Magnusson @ 2021-05-17  4:48 UTC (permalink / raw)
  To: zsh-workers

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-05-21 23:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-17  4:48 %! prompt code shows incorrect number Mikael Magnusson
2021-05-17  5:05 ` Bart Schaefer
2021-05-21 18:58   ` Mikael Magnusson
2021-05-21 23:55     ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).