Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Foreign Commands Not Appearing in 'history' Array When 'sharehistory' Option is Enabled Until a Command is Entered
- X-seq: zsh-users 30091
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: Langbart <Langbart@xxxxxxxxxxxxxx>, "zsh-users@xxxxxxx" <zsh-users@xxxxxxx>
- Subject: Re: Foreign Commands Not Appearing in 'history' Array When 'sharehistory' Option is Enabled Until a Command is Entered
- Date: Mon, 28 Oct 2024 18:35:05 +0100
- Archived-at: <https://zsh.org/users/30091>
- In-reply-to: <CAH+w=7ZOwgzV9gb-Zfn-NxWmpa0yPLvevLrApMSYK9S_qAdK-g@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <mwXIqemfp6p2u5-5ApP-6mjA8aw0SthwcBYnYnkHh13e_46s4ThESPJANCAKlEr2n9VBhClb1JwW_5IiYgljeAv9hJzfculpb9J6QF_lqQY=@protonmail.com> <CAH+w=7ZOwgzV9gb-Zfn-NxWmpa0yPLvevLrApMSYK9S_qAdK-g@mail.gmail.com>
On Mon, Oct 28, 2024 at 5:43 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> Short answers:
>
> On Mon, Oct 28, 2024 at 8:06 AM Langbart <Langbart@xxxxxxxxxxxxxx> 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.
I believe the OP is saying that after you execute a command in one
terminal and press ENTER in another terminal, within that second
terminal all widgets that operate on history, such as
history-incremental-search-backward, will see the command, but the
`history` array won't contain it. You would need to execute a
non-empty command in the second terminal for `history` to get updated.
This sounds quite strange and unexpected to me. Is this really
intended? Why is an empty command enough to for all history related
widgets to pick up commands executed in another terminal, but for
`history` to update you need to execute a non-empty command?
Roman
P.S.
I haven't actually tried it but this is my understanding based on what
the OP wrote here and on github.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author