From: Bart Schaefer <schaefer@brasslantern.com>
To: Langbart <Langbart@protonmail.com>
Cc: "zsh-users@zsh.org" <zsh-users@zsh.org>
Subject: Re: Foreign Commands Not Appearing in 'history' Array When 'sharehistory' Option is Enabled Until a Command is Entered
Date: Mon, 28 Oct 2024 09:42:46 -0700 [thread overview]
Message-ID: <CAH+w=7ZOwgzV9gb-Zfn-NxWmpa0yPLvevLrApMSYK9S_qAdK-g@mail.gmail.com> (raw)
In-Reply-To: <mwXIqemfp6p2u5-5ApP-6mjA8aw0SthwcBYnYnkHh13e_46s4ThESPJANCAKlEr2n9VBhClb1JwW_5IiYgljeAv9hJzfculpb9J6QF_lqQY=@protonmail.com>
[-- Attachment #1: Type: text/plain, Size: 964 bytes --]
Short answers:
On Mon, Oct 28, 2024 at 8:06 AM Langbart <Langbart@protonmail.com> wrote:
>
> is it a bug that when the 'sharehistory' option is enabled, commands from
> other shells ('foreign') aren't included in the 'history' array until the
> user enters a command?
>
No.
> Prepending 'fc -RI' before accessing the 'history' array seems to resolve
> the issue. Is this the recommended workaround to ensure that the 'history'
> array lists its resuls like 'fc -rl ...' does ?
>
Yes.
Longer answer:
When you're at a prompt, two things are going on. First, a history
position (the "next" number) has already been allocated for expansion of
the %h prompt escape, and loading from the shared history would have to
somehow fit "above" that. Second, the line editor is blocked on the
terminal driver waiting for input, it's not burning CPU in the background
polling the history file, etc., so you have to explicitly wake it up.
[-- Attachment #2: Type: text/html, Size: 1662 bytes --]
next prev parent reply other threads:[~2024-10-28 16:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-28 15:06 Langbart
2024-10-28 16:42 ` Bart Schaefer [this message]
2024-10-28 17:35 ` Roman Perepelitsa
2024-10-28 18:14 ` Bart Schaefer
2024-10-28 18:22 ` Roman Perepelitsa
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='CAH+w=7ZOwgzV9gb-Zfn-NxWmpa0yPLvevLrApMSYK9S_qAdK-g@mail.gmail.com' \
--to=schaefer@brasslantern.com \
--cc=Langbart@protonmail.com \
--cc=zsh-users@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).