zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: zsh-workers@zsh.org
Subject: %! prompt code shows incorrect number
Date: Mon, 17 May 2021 06:48:35 +0200	[thread overview]
Message-ID: <CAHYJk3R3jz8VJVTjOd-b3vpSeoBHJe3nc-PoLodnwWnnx_Jt0A@mail.gmail.com> (raw)

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


             reply	other threads:[~2021-05-17  4:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-17  4:48 Mikael Magnusson [this message]
2021-05-17  5:05 ` Bart Schaefer
2021-05-21 18:58   ` Mikael Magnusson
2021-05-21 23:55     ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHYJk3R3jz8VJVTjOd-b3vpSeoBHJe3nc-PoLodnwWnnx_Jt0A@mail.gmail.com \
    --to=mikachu@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).